github.com/josephspurrier/go-swagger@v0.2.1-0.20221129144919-1f672a142a00/examples/contributed-templates/stratoscale/swagger.yaml (about)

     1  swagger: '2.0'
     2  info:
     3    description: 'This is a sample server Petstore server.  You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).  For this sample, you can use the api key `special-key` to test the authorization filters.'
     4    version: 1.0.0
     5    title: Petstore
     6  host: petstore.service.strato
     7  basePath: /api/v2
     8  tags:
     9    - name: pet
    10      description: Everything about your Pets
    11      externalDocs:
    12        description: Find out more
    13        url: 'http://swagger.io'
    14    - name: store
    15      description: Access to Petstore orders
    16  schemes:
    17    - http
    18  consumes:
    19    - application/json
    20  produces:
    21    - application/json
    22  
    23  securityDefinitions:
    24    roles:
    25      type: apiKey
    26      in: header
    27      name: X-Auth-Roles
    28  
    29  security:
    30    - roles:
    31      - admin
    32  
    33  x-events:
    34    - name: pet_created
    35      message: "Pet ${pet_name} was created"
    36      entity_name: "pet"
    37      severity: "info"
    38      properties:
    39          pet_name: string
    40          pet_id: int64
    41    - name: pet_deleted
    42      entity_name: "pet"
    43      severity: "critical"
    44      message: "Pet ${pet_id} was deleted"
    45      properties:
    46          pet_id: integer
    47  
    48  paths:
    49  
    50    /pet:
    51  
    52      post:
    53        tags:
    54          - pet
    55        summary: Add a new pet to the store
    56        operationId: PetCreate
    57        parameters:
    58          - in: body
    59            name: body
    60            description: Pet object that needs to be added to the store
    61            required: true
    62            schema:
    63              $ref: '#/definitions/Pet'
    64        responses:
    65          201:
    66            description: Created
    67            schema:
    68              $ref: '#/definitions/Pet'
    69          405:
    70            description: Invalid input
    71  
    72      put:
    73        tags:
    74          - pet
    75        summary: Update an existing pet
    76        operationId: PetUpdate
    77        parameters:
    78          - in: body
    79            name: body
    80            description: Pet object that needs to be added to the store
    81            required: true
    82            schema:
    83              $ref: '#/definitions/Pet'
    84        responses:
    85          201:
    86            description: Updated successfully
    87            schema:
    88              $ref: '#/definitions/Pet'
    89          400:
    90            description: Invalid ID supplied
    91          404:
    92            description: Pet not found
    93          405:
    94            description: Validation exception
    95  
    96      get:
    97        tags:
    98          - pet
    99        summary: List pets
   100        operationId: PetList
   101        parameters:
   102          - name: status
   103            in: query
   104            description: Status values that need to be considered for filter
   105            required: true
   106            type: array
   107            items:
   108              type: string
   109              enum:
   110                - available
   111                - pending
   112                - sold
   113              default: available
   114            collectionFormat: multi
   115        responses:
   116          200:
   117            description: successful operation
   118            schema:
   119              type: array
   120              items:
   121                $ref: '#/definitions/Pet'
   122          400:
   123            description: Invalid status value
   124        security:
   125          - roles:
   126            - admin
   127            - member
   128  
   129    /pet/{petId}:
   130  
   131      get:
   132        tags:
   133          - pet
   134        summary: Get pet by it's ID
   135        operationId: PetGet
   136  
   137        parameters:
   138          - name: petId
   139            in: path
   140            description: ID of pet to return
   141            required: true
   142            type: integer
   143            format: int64
   144        responses:
   145          200:
   146            description: successful operation
   147            schema:
   148              $ref: '#/definitions/Pet'
   149          400:
   150            description: Invalid ID supplied
   151          404:
   152            description: Pet not found
   153        security:
   154          - roles:
   155            - admin
   156            - member
   157  
   158      delete:
   159        tags:
   160          - pet
   161        summary: Deletes a pet
   162        description: ''
   163        operationId: PetDelete
   164  
   165        parameters:
   166          - name: api_key
   167            in: header
   168            required: false
   169            type: string
   170          - name: petId
   171            in: path
   172            description: Pet id to delete
   173            required: true
   174            type: integer
   175            format: int64
   176        responses:
   177          204:
   178            description: Deleted successfully
   179          400:
   180            description: Invalid ID supplied
   181          404:
   182            description: Pet not found
   183  
   184    /pet/{petId}/image:
   185  
   186      post:
   187        tags:
   188          - pet
   189        summary: uploads an image
   190        description: ''
   191        operationId: PetUploadImage
   192        parameters:
   193          - name: petId
   194            in: path
   195            description: ID of pet to update
   196            required: true
   197            type: integer
   198            format: int64
   199          - name: additionalMetadata
   200            in: formData
   201            description: Additional data to pass to server
   202            required: false
   203            type: string
   204          - name: file
   205            in: formData
   206            description: file to upload
   207            required: false
   208            type: file
   209        responses:
   210          200:
   211            description: successful operation
   212            schema:
   213              $ref: '#/definitions/ApiResponse'
   214  
   215    /store/inventory:
   216  
   217      get:
   218        tags:
   219          - store
   220        summary: Returns pet inventories by status
   221        operationId: InventoryGet
   222        responses:
   223          200:
   224            description: successful operation
   225            schema:
   226              type: object
   227              additionalProperties:
   228                type: integer
   229                format: int32
   230  
   231    /store/order:
   232  
   233      post:
   234        tags:
   235          - store
   236        summary: Place an order for a pet
   237        operationId: OrderCreate
   238  
   239        parameters:
   240          - in: body
   241            name: body
   242            description: order placed for purchasing the pet
   243            required: true
   244            schema:
   245              $ref: '#/definitions/Order'
   246        responses:
   247          200:
   248            description: successful operation
   249            schema:
   250              $ref: '#/definitions/Order'
   251          400:
   252            description: Invalid Order
   253  
   254    /store/order/{orderId}:
   255  
   256      get:
   257        tags:
   258          - store
   259        summary: Find purchase order by ID
   260        description: For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions
   261        operationId: OrderGet
   262  
   263        parameters:
   264          - name: orderId
   265            in: path
   266            description: ID of pet that needs to be fetched
   267            required: true
   268            type: integer
   269            maximum: 10
   270            minimum: 1
   271            format: int64
   272        responses:
   273          200:
   274            description: successful operation
   275            schema:
   276              $ref: '#/definitions/Order'
   277          400:
   278            description: Invalid ID supplied
   279          404:
   280            description: Order not found
   281  
   282      delete:
   283        tags:
   284          - store
   285        summary: Delete purchase order by ID
   286        description: For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors
   287        operationId: OrderDelete
   288  
   289        parameters:
   290          - name: orderId
   291            in: path
   292            description: ID of the order that needs to be deleted
   293            required: true
   294            type: integer
   295            minimum: 1
   296            format: int64
   297        responses:
   298          204:
   299            description: Deleted successfully
   300          400:
   301            description: Invalid ID supplied
   302          404:
   303            description: Order not found
   304  
   305  definitions:
   306    Order:
   307      type: object
   308      properties:
   309        id:
   310          type: integer
   311          format: int64
   312        petId:
   313          type: integer
   314          format: int64
   315        quantity:
   316          type: integer
   317          format: int32
   318        shipDate:
   319          type: string
   320          format: date-time
   321        status:
   322          type: string
   323          description: Order Status
   324          enum:
   325            - placed
   326            - approved
   327            - delivered
   328        complete:
   329          type: boolean
   330          default: false
   331  
   332    Category:
   333      type: object
   334      properties:
   335        id:
   336          type: integer
   337          format: int64
   338        name:
   339          type: string
   340  
   341    Tag:
   342      type: object
   343      properties:
   344        id:
   345          type: integer
   346          format: int64
   347        name:
   348          type: string
   349  
   350    Pet:
   351      type: object
   352      required:
   353        - name
   354        - photoUrls
   355      properties:
   356        id:
   357          type: integer
   358          format: int64
   359          x-go-custom-tag: gorm:"primary_key" query:"filter,sort"
   360        category:
   361          $ref: '#/definitions/Category'
   362        name:
   363          type: string
   364          example: doggie
   365          x-go-custom-tag: query:"filter,sort"
   366        photoUrls:
   367          type: array
   368          items:
   369            type: string
   370          x-go-custom-tag: gorm:"-"
   371        tags:
   372          type: array
   373          items:
   374            $ref: '#/definitions/Tag'
   375        status:
   376          type: string
   377          description: pet status in the store
   378          enum:
   379            - available
   380            - pending
   381            - sold
   382          x-go-custom-tag: query:"filter,sort"
   383    ApiResponse:
   384      title: is the response to an API call
   385      type: object
   386      properties:
   387        code:
   388          type: integer
   389          format: int32
   390        type:
   391          type: string
   392        message:
   393          type: string
   394  externalDocs:
   395    description: Find out more about Swagger
   396    url: 'http://swagger.io'