Last active
October 27, 2017 16:23
-
-
Save wshirey/1f5d9bc7f8b5891a454f9e5d2d4c122f to your computer and use it in GitHub Desktop.
pet swagger example with additionalproperties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
swagger: "2.0" | |
info: | |
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." | |
version: "1.0.0" | |
title: "Swagger Petstore" | |
termsOfService: "http://swagger.io/terms/" | |
contact: | |
email: "apiteam@swagger.io" | |
license: | |
name: "Apache 2.0" | |
url: "http://www.apache.org/licenses/LICENSE-2.0.html" | |
host: "petstore.swagger.io" | |
basePath: "/v2" | |
tags: | |
- name: "pet" | |
description: "Everything about your Pets" | |
externalDocs: | |
description: "Find out more" | |
url: "http://swagger.io" | |
- name: "store" | |
description: "Access to Petstore orders" | |
- name: "user" | |
description: "Operations about user" | |
externalDocs: | |
description: "Find out more about our store" | |
url: "http://swagger.io" | |
schemes: | |
- "http" | |
paths: | |
/pet: | |
post: | |
tags: | |
- "pet" | |
summary: "Add a new pet to the store" | |
description: "" | |
operationId: "addPet" | |
consumes: | |
- "application/json" | |
- "application/xml" | |
produces: | |
- "application/xml" | |
- "application/json" | |
parameters: | |
- in: "body" | |
name: "body" | |
description: "Pet object that needs to be added to the store" | |
required: true | |
schema: | |
$ref: "#/definitions/Pet" | |
responses: | |
200: | |
description: OK | |
definitions: | |
Category: | |
type: "object" | |
properties: | |
id: | |
type: "integer" | |
format: "int64" | |
name: | |
type: "string" | |
xml: | |
name: "Category" | |
Tag: | |
type: "object" | |
properties: | |
id: | |
type: "integer" | |
format: "int64" | |
name: | |
type: "string" | |
xml: | |
name: "Tag" | |
Pet: | |
type: "object" | |
required: | |
- "name" | |
- "photoUrls" | |
properties: | |
id: | |
type: "integer" | |
format: "int64" | |
category: | |
$ref: "#/definitions/Category" | |
name: | |
type: "string" | |
example: "doggie" | |
photoUrls: | |
type: "array" | |
xml: | |
name: "photoUrl" | |
wrapped: true | |
items: | |
type: "string" | |
tags: | |
type: "array" | |
xml: | |
name: "tag" | |
wrapped: true | |
items: | |
$ref: "#/definitions/Tag" | |
status: | |
type: "string" | |
description: "pet status in the store" | |
enum: | |
- "available" | |
- "pending" | |
- "sold" | |
dictionary: | |
type: object | |
additionalProperties: | |
type: object | |
properties: | |
code: | |
type: integer | |
text: | |
type: string | |
xml: | |
name: "Pet" | |
ApiResponse: | |
type: "object" | |
properties: | |
code: | |
type: "integer" | |
format: "int32" | |
type: | |
type: "string" | |
message: | |
type: "string" | |
externalDocs: | |
description: "Find out more about Swagger" | |
url: "http://swagger.io" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment