openapi: '3.0.0' info: version: 1.0.0 title: Swagger Petstore description: A sample API termsOfService: http://swagger.io/terms/ license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html servers: - url: /v1 paths: /ping: get: description: | ping then pong! # operationId is used in /ping path (x-eov-operation-id is optional). x-eov-operation-id can be used in place of operationId. If both x-eov-operation-id and operationId are present, x-eov-operation-id will override operationId. operationId: ping x-eov-operation-handler: routes/ping responses: '200': description: OK content: text/plain: schema: type: string example: pong default: description: unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' /pets: get: description: | Returns all pets # x-eov-operation-id is specified as well as operationId. This allows for backwards compatibility with code generator tools that rely on operationId in the OpenAPI spec. x-eov-operation-id: pets#list x-eov-operation-handler: routes/pets parameters: - name: type in: query description: maximum number of results to return required: true schema: type: string enum: - dog - cat - name: tags in: query description: tags to filter by required: false style: form schema: type: array items: type: string - name: limit in: query description: maximum number of results to return required: true schema: type: integer format: int32 minimum: 1 maximum: 20 responses: '200': description: pet response content: application/json: schema: type: array items: $ref: '#/components/schemas/Pet' default: description: unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' post: description: Creates a new pet in the store. operationId: createPet x-eov-operation-id: pets#create ## overrides operationId x-eov-operation-handler: routes/pets security: - ApiKeyAuth: [] requestBody: description: Pet to add to the store required: true content: application/json: schema: $ref: '#/components/schemas/Pet' responses: '200': description: pet response content: application/json: schema: $ref: '#/components/schemas/Pet' default: description: unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' /pets/{id}: get: description: Returns a user based on a single ID, if the user does not have access to the pet operationId: findPetById x-eov-operation-id: pets#pet ## overrides operationId x-eov-operation-handler: routes/pets parameters: - name: id in: path description: ID of pet to fetch required: true schema: type: integer format: int64 responses: '200': description: pet response content: application/json: schema: $ref: '#/components/schemas/Pet' default: description: unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' delete: description: deletes a single pet based on the ID supplied operationId: deletePet x-eov-operation-id: pets#delete x-eov-operation-handler: routes/pets parameters: - name: id in: path description: ID of pet to delete required: true schema: type: integer format: int64 responses: '204': description: pet deleted default: description: unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' /pets/{id}/photos: post: description: upload a photo of the pet operationId: uploadPetPhoto x-eov-operation-id: pets#petPhotos ## overrides operationId x-eov-operation-handler: routes/pets parameters: - name: id in: path description: ID of pet to fetch required: true schema: type: integer format: int64 requestBody: content: multipart/form-data: schema: # $ref: '#/components/schemas/NewPhoto' type: object required: - file properties: file: description: The photo type: string format: binary required: true responses: 201: description: Created content: application/json: schema: type: object properties: success: type: boolean # "/pets:lookup": # get: # description: | # Returns all pets # x-eov-operation-id: pets#list # x-eov-operation-handler: routes/pets # parameters: # - name: type # in: query # description: maximum number of results to return # required: true # schema: # type: string # enum: # - dog # - cat # responses: # '200': # description: pet response # content: # application/json: # schema: # type: array # items: # $ref: '#/components/schemas/Pet' components: schemas: Pet: required: - id - name - type properties: id: readOnly: true type: number name: type: string tag: type: string type: $ref: '#/components/schemas/PetType' PetType: type: string enum: - dog - cat Error: required: - code - message properties: code: type: integer format: int32 message: type: string securitySchemes: ApiKeyAuth: type: apiKey in: header name: X-API-Key