fix
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
openapi: 3.0.0
|
||||
info:
|
||||
title: Bearer auth test
|
||||
version: 1.0.0
|
||||
servers:
|
||||
# - url: https://httpbin.org # live external url
|
||||
- url: http://localhost:3231 # will need to mock
|
||||
paths:
|
||||
/get:
|
||||
get:
|
||||
responses:
|
||||
'200':
|
||||
description: ok
|
||||
security:
|
||||
- bearerAuth: []
|
||||
components:
|
||||
securitySchemes:
|
||||
bearerAuth:
|
||||
type: http
|
||||
scheme: bearer
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
openapi: 3.0.0
|
||||
|
||||
info:
|
||||
version: "1.0"
|
||||
title: PKCE Flow
|
||||
|
||||
paths:
|
||||
/:
|
||||
get:
|
||||
summary: dummy operation
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
|
||||
components:
|
||||
securitySchemes:
|
||||
testAuthCodeFlow:
|
||||
type: oauth2
|
||||
flows:
|
||||
authorizationCode:
|
||||
authorizationUrl: /oauth/authorize
|
||||
tokenUrl: /oauth/token
|
||||
scopes:
|
||||
read: read whatever you want
|
||||
write: write whatever you want
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
openapi: "3.0.0"
|
||||
|
||||
paths:
|
||||
/:
|
||||
get:
|
||||
operationId: "myOperation"
|
||||
tags: ["myTag"]
|
||||
summary: an operation
|
||||
responses:
|
||||
'200':
|
||||
description: a pet to be returned
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
/withSpaces:
|
||||
post:
|
||||
operationId: "my Operation"
|
||||
tags: ["my Tag"]
|
||||
summary: an operation
|
||||
responses:
|
||||
'200':
|
||||
description: a pet to be returned
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
/utf16fragments:
|
||||
head:
|
||||
operationId: "пошел"
|
||||
tags: ["шеллы"]
|
||||
summary: an operation
|
||||
responses:
|
||||
"200":
|
||||
description: ok
|
||||
/withUnderscores:
|
||||
patch:
|
||||
operationId: "underscore_Operation"
|
||||
tags: ["underscore_Tag"]
|
||||
summary: an operation
|
||||
responses:
|
||||
'200':
|
||||
description: a pet to be returned
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
/noOperationId:
|
||||
put:
|
||||
tags: ["tagTwo"]
|
||||
summary: some operations are anonymous...
|
||||
responses:
|
||||
'200':
|
||||
description: a pet to be returned
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
swagger: "2.0"
|
||||
|
||||
paths:
|
||||
/:
|
||||
get:
|
||||
operationId: "myOperation"
|
||||
tags: ["myTag"]
|
||||
summary: an operation
|
||||
responses:
|
||||
"200":
|
||||
description: ok
|
||||
/withSpaces:
|
||||
post:
|
||||
operationId: "my Operation"
|
||||
tags: ["my Tag"]
|
||||
summary: an operation
|
||||
responses:
|
||||
"200":
|
||||
description: ok
|
||||
/utf16fragments:
|
||||
head:
|
||||
operationId: "пошел"
|
||||
tags: ["шеллы"]
|
||||
/withUnderscores:
|
||||
patch:
|
||||
operationId: "underscore_Operation"
|
||||
tags: ["underscore_Tag"]
|
||||
summary: an operation
|
||||
responses:
|
||||
"200":
|
||||
description: ok
|
||||
/noOperationId:
|
||||
put:
|
||||
tags: ["tagTwo"]
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
openapi: 3.0.2
|
||||
|
||||
info:
|
||||
title: External Docs
|
||||
version: "1"
|
||||
|
||||
externalDocs:
|
||||
description: Read external docs
|
||||
url: http://swagger.io
|
||||
|
||||
tags:
|
||||
- name: pet
|
||||
description: Everything about your Pets
|
||||
externalDocs:
|
||||
description: Pet Documentation
|
||||
url: http://swagger.io
|
||||
- name: petWithoutDescription
|
||||
externalDocs:
|
||||
url: http://swagger.io
|
||||
|
||||
paths:
|
||||
/pet:
|
||||
put:
|
||||
externalDocs:
|
||||
description: More details about putting a pet
|
||||
url: http://swagger.io
|
||||
tags:
|
||||
- pet
|
||||
summary: Update an existing pet
|
||||
description: Update an existing pet by Id
|
||||
operationId: updatePet
|
||||
requestBody:
|
||||
description: Update an existent pet in the store
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: Successful operation
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
"400":
|
||||
description: Invalid ID supplied
|
||||
"404":
|
||||
description: Pet not found
|
||||
"405":
|
||||
description: Validation exception
|
||||
post:
|
||||
externalDocs:
|
||||
url: http://swagger.io
|
||||
tags:
|
||||
- pet
|
||||
summary: Add a new pet to the store
|
||||
description: Add a new pet to the store
|
||||
operationId: addPet
|
||||
requestBody:
|
||||
description: Create a new pet in the store
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
required: true
|
||||
responses:
|
||||
"200":
|
||||
description: Successful operation
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
"405":
|
||||
description: Invalid input
|
||||
|
||||
components:
|
||||
schemas:
|
||||
Pet:
|
||||
required:
|
||||
- name
|
||||
- photoUrls
|
||||
type: object
|
||||
description: This is a Pet
|
||||
externalDocs:
|
||||
description: More Docs About Pet
|
||||
url: http://swagger.io
|
||||
deprecated: true
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
example: 10
|
||||
name:
|
||||
type: string
|
||||
example: doggie
|
||||
photoUrls:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
status:
|
||||
type: string
|
||||
description: pet status in the store
|
||||
enum:
|
||||
- available
|
||||
- pending
|
||||
- sold
|
||||
Object:
|
||||
type: object
|
||||
externalDocs:
|
||||
description: Object Docs
|
||||
url: http://swagger.io
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
ObjectWithoutDescription:
|
||||
type: object
|
||||
externalDocs:
|
||||
url: http://swagger.io
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
Primitive:
|
||||
description: Just a string schema
|
||||
type: string
|
||||
externalDocs:
|
||||
description: Primitive Docs
|
||||
url: http://swagger.io
|
||||
PrimitiveWithoutDescription:
|
||||
description: Just a string schema
|
||||
type: string
|
||||
externalDocs:
|
||||
url: http://swagger.io
|
||||
Array:
|
||||
description: Just an array schema
|
||||
type: array
|
||||
externalDocs:
|
||||
description: Array Docs
|
||||
url: http://swagger.io
|
||||
items:
|
||||
type: string
|
||||
ArrayWithoutDescription:
|
||||
description: Just an array schema
|
||||
type: array
|
||||
externalDocs:
|
||||
url: http://swagger.io
|
||||
items:
|
||||
type: string
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
swagger: "2.0"
|
||||
|
||||
info:
|
||||
title: External Docs
|
||||
version: "1"
|
||||
|
||||
externalDocs:
|
||||
description: Read external docs
|
||||
url: http://swagger.io
|
||||
|
||||
tags:
|
||||
- name: pet
|
||||
description: Everything about your Pets
|
||||
externalDocs:
|
||||
description: Pet Documentation
|
||||
url: http://swagger.io
|
||||
- name: petWithoutDescription
|
||||
externalDocs:
|
||||
url: http://swagger.io
|
||||
|
||||
paths:
|
||||
/pet:
|
||||
put:
|
||||
externalDocs:
|
||||
description: More details about putting a pet
|
||||
url: http://swagger.io
|
||||
tags:
|
||||
- pet
|
||||
summary: Update an existing pet
|
||||
description: Update an existing pet by Id
|
||||
operationId: updatePet
|
||||
responses:
|
||||
200:
|
||||
description: OK
|
||||
post:
|
||||
externalDocs:
|
||||
url: http://swagger.io
|
||||
tags:
|
||||
- pet
|
||||
summary: Add a new pet to the store
|
||||
description: Add a new pet to the store
|
||||
operationId: addPet
|
||||
responses:
|
||||
201:
|
||||
description: Created
|
||||
|
||||
definitions:
|
||||
Pet:
|
||||
required:
|
||||
- name
|
||||
- photoUrls
|
||||
type: object
|
||||
description: This is a Pet
|
||||
externalDocs:
|
||||
description: More Docs About Pet
|
||||
url: http://swagger.io
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
example: 10
|
||||
name:
|
||||
type: string
|
||||
example: doggie
|
||||
photoUrls:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
status:
|
||||
type: string
|
||||
description: pet status in the store
|
||||
enum:
|
||||
- available
|
||||
- pending
|
||||
- sold
|
||||
Object:
|
||||
type: object
|
||||
externalDocs:
|
||||
description: Object Docs
|
||||
url: http://swagger.io
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
ObjectWithoutDescription:
|
||||
type: object
|
||||
externalDocs:
|
||||
url: http://swagger.io
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
Primitive:
|
||||
description: Just a string schema
|
||||
type: string
|
||||
externalDocs:
|
||||
description: Primitive Docs
|
||||
url: http://swagger.io
|
||||
PrimitiveWithoutDescription:
|
||||
description: Just a string schema
|
||||
type: string
|
||||
externalDocs:
|
||||
url: http://swagger.io
|
||||
Array:
|
||||
description: Just an array schema
|
||||
type: array
|
||||
externalDocs:
|
||||
description: Array Docs
|
||||
url: http://swagger.io
|
||||
items:
|
||||
type: string
|
||||
ArrayWithoutDescription:
|
||||
description: Just an array schema
|
||||
type: array
|
||||
externalDocs:
|
||||
url: http://swagger.io
|
||||
items:
|
||||
type: string
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
openapi: "3.0.0"
|
||||
|
||||
components:
|
||||
schemas:
|
||||
Order:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
petId:
|
||||
type: integer
|
||||
format: int64
|
||||
quantity:
|
||||
type: integer
|
||||
format: int32
|
||||
shipDate:
|
||||
type: string
|
||||
format: date-time
|
||||
status:
|
||||
type: string
|
||||
description: Order Status
|
||||
enum:
|
||||
- placed
|
||||
- approved
|
||||
- delivered
|
||||
complete:
|
||||
type: boolean
|
||||
default: false
|
||||
xml:
|
||||
name: Order
|
||||
User:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
username:
|
||||
type: string
|
||||
firstName:
|
||||
type: string
|
||||
lastName:
|
||||
type: string
|
||||
email:
|
||||
type: string
|
||||
password:
|
||||
type: string
|
||||
phone:
|
||||
type: string
|
||||
userStatus:
|
||||
type: integer
|
||||
format: int32
|
||||
description: User Status
|
||||
xml:
|
||||
name: User
|
||||
Pet:
|
||||
type: object
|
||||
required:
|
||||
- name
|
||||
- photoUrls
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
category:
|
||||
$ref: '#/components/schemas/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: '#/components/schemas/Tag'
|
||||
status:
|
||||
type: string
|
||||
description: pet status in the store
|
||||
enum:
|
||||
- available
|
||||
- pending
|
||||
- sold
|
||||
xml:
|
||||
name: Pet
|
||||
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
swagger: "2.0"
|
||||
|
||||
definitions:
|
||||
Order:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
petId:
|
||||
type: integer
|
||||
format: int64
|
||||
quantity:
|
||||
type: integer
|
||||
format: int32
|
||||
shipDate:
|
||||
type: string
|
||||
format: date-time
|
||||
status:
|
||||
type: string
|
||||
description: Order Status
|
||||
enum:
|
||||
- placed
|
||||
- approved
|
||||
- delivered
|
||||
complete:
|
||||
type: boolean
|
||||
default: false
|
||||
xml:
|
||||
name: Order
|
||||
User:
|
||||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
username:
|
||||
type: string
|
||||
firstName:
|
||||
type: string
|
||||
lastName:
|
||||
type: string
|
||||
email:
|
||||
type: string
|
||||
password:
|
||||
type: string
|
||||
phone:
|
||||
type: string
|
||||
userStatus:
|
||||
type: integer
|
||||
format: int32
|
||||
description: User Status
|
||||
xml:
|
||||
name: User
|
||||
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
|
||||
xml:
|
||||
name: Pet
|
||||
|
||||
+400
@@ -0,0 +1,400 @@
|
||||
openapi: 3.0.0
|
||||
info:
|
||||
title: "Multiple Examples: Core Document"
|
||||
description: |
|
||||
This document has examples for straightforward usage of `examples` in...
|
||||
* Parameter Object positions
|
||||
* Response Object positions
|
||||
* Request Body Object positions
|
||||
|
||||
It includes:
|
||||
* cases for each JSON Schema type as an example value (except null) in each position
|
||||
* variously-sized `examples` objects
|
||||
* multi-paragraph descriptions within each example
|
||||
|
||||
It **does not** include the following out-of-scope items:
|
||||
* usage of `examples` within `Parameter.content` or `Response.content`
|
||||
* `externalValue` (might change)
|
||||
|
||||
It also lacks edge cases, which will be covered in the "Corner" Document:
|
||||
* `examples` n=1, which presents an interesting UI problem w/ the dropdown
|
||||
* `example` and `examples` both present
|
||||
* example item value that doesn't match the input type
|
||||
* e.g., `Parameter.type === "number"`, but `Parameter.examples.[key].value` is an object
|
||||
* `null` as an example value
|
||||
version: "1.0.2"
|
||||
paths:
|
||||
/String:
|
||||
post:
|
||||
summary: "Bonus: contains two requestBody media types"
|
||||
parameters:
|
||||
- in: query
|
||||
name: message
|
||||
required: true
|
||||
description: This parameter just so happens to have a one-line description.
|
||||
schema:
|
||||
type: string
|
||||
examples:
|
||||
StringExampleA:
|
||||
$ref: '#/components/examples/StringExampleA'
|
||||
StringExampleB:
|
||||
$ref: '#/components/examples/StringExampleB'
|
||||
requestBody:
|
||||
description: the wonderful payload of my request
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
examples:
|
||||
StringExampleA:
|
||||
$ref: '#/components/examples/StringExampleA'
|
||||
StringExampleB:
|
||||
$ref: '#/components/examples/StringExampleB'
|
||||
text/plain+other:
|
||||
schema:
|
||||
type: string
|
||||
examples:
|
||||
StringExampleA:
|
||||
$ref: '#/components/examples/StringExampleA'
|
||||
StringExampleB:
|
||||
$ref: '#/components/examples/StringExampleB'
|
||||
responses:
|
||||
200:
|
||||
description: has two media types; the second has a third example!
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
examples:
|
||||
StringExampleA:
|
||||
$ref: '#/components/examples/StringExampleA'
|
||||
StringExampleB:
|
||||
$ref: '#/components/examples/StringExampleB'
|
||||
text/plain+other:
|
||||
schema:
|
||||
type: string
|
||||
examples:
|
||||
StringExampleA:
|
||||
$ref: '#/components/examples/StringExampleA'
|
||||
StringExampleB:
|
||||
$ref: '#/components/examples/StringExampleB'
|
||||
StringExampleC:
|
||||
$ref: '#/components/examples/StringExampleC'
|
||||
/Number:
|
||||
post:
|
||||
parameters:
|
||||
- in: query
|
||||
name: message
|
||||
required: true
|
||||
schema:
|
||||
type: number
|
||||
examples:
|
||||
NumberExampleA:
|
||||
$ref: '#/components/examples/NumberExampleA'
|
||||
NumberExampleB:
|
||||
$ref: '#/components/examples/NumberExampleB'
|
||||
NumberExampleC:
|
||||
$ref: '#/components/examples/NumberExampleC'
|
||||
requestBody:
|
||||
description: the wonderful payload of my request
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: number
|
||||
examples:
|
||||
NumberExampleA:
|
||||
$ref: '#/components/examples/NumberExampleA'
|
||||
NumberExampleB:
|
||||
$ref: '#/components/examples/NumberExampleB'
|
||||
NumberExampleC:
|
||||
$ref: '#/components/examples/NumberExampleC'
|
||||
text/plain+other:
|
||||
schema:
|
||||
type: number
|
||||
examples:
|
||||
NumberExampleA:
|
||||
$ref: '#/components/examples/NumberExampleA'
|
||||
NumberExampleB:
|
||||
$ref: '#/components/examples/NumberExampleB'
|
||||
NumberExampleC:
|
||||
$ref: '#/components/examples/NumberExampleC'
|
||||
responses:
|
||||
200:
|
||||
description: OK!
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: number
|
||||
examples:
|
||||
NumberExampleA:
|
||||
$ref: '#/components/examples/NumberExampleA'
|
||||
NumberExampleB:
|
||||
$ref: '#/components/examples/NumberExampleB'
|
||||
text/plain+other:
|
||||
schema:
|
||||
type: number
|
||||
examples:
|
||||
NumberExampleA:
|
||||
$ref: '#/components/examples/NumberExampleA'
|
||||
NumberExampleB:
|
||||
$ref: '#/components/examples/NumberExampleB'
|
||||
NumberExampleC:
|
||||
$ref: '#/components/examples/NumberExampleC'
|
||||
/Boolean:
|
||||
post:
|
||||
parameters:
|
||||
- in: query
|
||||
name: message
|
||||
required: true
|
||||
schema:
|
||||
type: boolean
|
||||
examples:
|
||||
BooleanExampleA:
|
||||
$ref: '#/components/examples/BooleanExampleA'
|
||||
BooleanExampleB:
|
||||
$ref: '#/components/examples/BooleanExampleB'
|
||||
requestBody:
|
||||
description: the wonderful payload of my request
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: boolean
|
||||
examples:
|
||||
BooleanExampleA:
|
||||
$ref: '#/components/examples/BooleanExampleA'
|
||||
BooleanExampleB:
|
||||
$ref: '#/components/examples/BooleanExampleB'
|
||||
text/plain+other:
|
||||
schema:
|
||||
type: boolean
|
||||
examples:
|
||||
BooleanExampleA:
|
||||
$ref: '#/components/examples/BooleanExampleA'
|
||||
BooleanExampleB:
|
||||
$ref: '#/components/examples/BooleanExampleB'
|
||||
responses:
|
||||
200:
|
||||
description: OK!
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: boolean
|
||||
examples:
|
||||
BooleanExampleA:
|
||||
$ref: '#/components/examples/BooleanExampleA'
|
||||
BooleanExampleB:
|
||||
$ref: '#/components/examples/BooleanExampleB'
|
||||
text/plain+other:
|
||||
schema:
|
||||
type: boolean
|
||||
examples:
|
||||
BooleanExampleA:
|
||||
$ref: '#/components/examples/BooleanExampleA'
|
||||
BooleanExampleB:
|
||||
$ref: '#/components/examples/BooleanExampleB'
|
||||
/Array:
|
||||
post:
|
||||
parameters:
|
||||
- in: query
|
||||
name: message
|
||||
required: true
|
||||
schema:
|
||||
type: array
|
||||
items: {} # intentionally empty; don't want to assert on the items
|
||||
examples:
|
||||
ArrayExampleA:
|
||||
$ref: '#/components/examples/ArrayExampleA'
|
||||
ArrayExampleB:
|
||||
$ref: '#/components/examples/ArrayExampleB'
|
||||
ArrayExampleC:
|
||||
$ref: '#/components/examples/ArrayExampleC'
|
||||
requestBody:
|
||||
description: the wonderful payload of my request
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items: {} # intentionally empty; don't want to assert on the items
|
||||
examples:
|
||||
ArrayExampleA:
|
||||
$ref: '#/components/examples/ArrayExampleA'
|
||||
ArrayExampleB:
|
||||
$ref: '#/components/examples/ArrayExampleB'
|
||||
ArrayExampleC:
|
||||
$ref: '#/components/examples/ArrayExampleC'
|
||||
responses:
|
||||
200:
|
||||
description: OK!
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items: {} # intentionally empty; don't want to assert on the items
|
||||
examples:
|
||||
ArrayExampleA:
|
||||
$ref: '#/components/examples/ArrayExampleA'
|
||||
ArrayExampleB:
|
||||
$ref: '#/components/examples/ArrayExampleB'
|
||||
ArrayExampleC:
|
||||
$ref: '#/components/examples/ArrayExampleC'
|
||||
/Object:
|
||||
post:
|
||||
parameters:
|
||||
- in: query
|
||||
name: data
|
||||
required: true
|
||||
schema:
|
||||
type: object
|
||||
examples:
|
||||
ObjectExampleA:
|
||||
$ref: '#/components/examples/ObjectExampleA'
|
||||
ObjectExampleB:
|
||||
$ref: '#/components/examples/ObjectExampleB'
|
||||
requestBody:
|
||||
description: the wonderful payload of my request
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
examples:
|
||||
ObjectExampleA:
|
||||
$ref: '#/components/examples/ObjectExampleA'
|
||||
ObjectExampleB:
|
||||
$ref: '#/components/examples/ObjectExampleB'
|
||||
text/plain+other:
|
||||
schema:
|
||||
type: object
|
||||
examples:
|
||||
ObjectExampleA:
|
||||
$ref: '#/components/examples/ObjectExampleA'
|
||||
ObjectExampleB:
|
||||
$ref: '#/components/examples/ObjectExampleB'
|
||||
responses:
|
||||
200:
|
||||
description: OK!
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
examples:
|
||||
ObjectExampleA:
|
||||
$ref: '#/components/examples/ObjectExampleA'
|
||||
ObjectExampleB:
|
||||
$ref: '#/components/examples/ObjectExampleB'
|
||||
text/plain+other:
|
||||
schema:
|
||||
type: object
|
||||
examples:
|
||||
ObjectExampleA:
|
||||
$ref: '#/components/examples/ObjectExampleA'
|
||||
ObjectExampleB:
|
||||
$ref: '#/components/examples/ObjectExampleB'
|
||||
components:
|
||||
examples:
|
||||
StringExampleA:
|
||||
value: "hello world"
|
||||
summary: Don't just string me along...
|
||||
description: |
|
||||
A string in C is actually a character array. As an individual character variable can store only one character, we need an array of characters to store strings. Thus, in C string is stored in an array of characters. Each character in a string occupies one location in an array. The null character ‘\0’ is put after the last character. This is done so that program can tell when the end of the string has been reached.
|
||||
|
||||
For example, the string “Hello” is stored as follows...
|
||||
|
||||

|
||||
|
||||
Since the string contains 5 characters. it requires a character array of size 6 to store it. the last character in a string is always a NULL('\0') character. Always keep in mind that the '\0' is not included in the length if the string, so here the length of the string is 5 only. Notice above that the indexes of the string starts from 0 not one so don't confuse yourself with index and length of string.
|
||||
|
||||
Thus, in C, a string is a one-dimensional array of characters terminated a null character. The terminating null character is important. In fact, a string not terminated by ‘\0’ is not really a string, but merely a collection of characters.
|
||||
StringExampleB:
|
||||
value: "The quick brown fox jumps over the lazy dog"
|
||||
summary: "I'm a pangram!"
|
||||
description: |
|
||||
A pangram (Greek: παν γράμμα, pan gramma, "every letter") or holoalphabetic sentence is a sentence using every letter of a given alphabet at least once. Pangrams have been used to display typefaces, test equipment, and develop skills in handwriting, calligraphy, and keyboarding.
|
||||
|
||||
The best-known English pangram is "The quick brown fox jumps over the lazy dog". It has been used since at least the late 19th century, was utilized by Western Union to test Telex / TWX data communication equipment for accuracy and reliability, and is now used by a number of computer programs (most notably the font viewer built into Microsoft Windows) to display computer fonts.
|
||||
|
||||
Pangrams exist in practically every alphabet-based language. An example from German is _Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich_, which contains all letters, including every umlaut (ä, ö, ü) plus the ß. It has been used since before 1800.
|
||||
|
||||
In a sense, the pangram is the opposite of the lipogram, in which the aim is to omit one or more letters.
|
||||
|
||||
A perfect pangram contains every letter of the alphabet only once and
|
||||
can be considered an anagram of the alphabet. The only perfect pangrams
|
||||
that are known either use abbreviations, such as "Mr Jock, TV quiz PhD,
|
||||
bags few lynx", or use words so obscure that the phrase is hard to
|
||||
understand, such as "Cwm fjord bank glyphs vext quiz", where cwm is a
|
||||
loan word from the Welsh language meaning a steep-sided valley, and vext
|
||||
is an uncommon way to spell vexed.
|
||||
StringExampleC:
|
||||
value: "JavaScript rules"
|
||||
summary: "A third example, for use in special places..."
|
||||
NumberExampleA:
|
||||
value: 7710263025
|
||||
summary: "World population"
|
||||
description: |
|
||||
In demographics, the world population is the total number of humans currently living, and was estimated to have reached 7.7 billion people as of April 2019. It took over 200,000 years of human history for the world's population to reach 1 billion; and only 200 years more to reach 7 billion.
|
||||
|
||||
World population has experienced continuous growth since the end of the Great Famine of 1315–1317 and the Black Death in 1350, when it was near 370 million. The highest population growth rates – global population increases above 1.8% per year – occurred between 1955 and 1975, peaking to 2.1% between 1965 and 1970. The growth rate has declined to 1.2% between 2010 and 2015 and is projected to decline further in the course of the 21st century. However, the global population is still growing and is projected to reach about 10 billion in 2050 and more than 11 billion in 2100.
|
||||
|
||||
Total annual births were highest in the late 1980s at about 139 million, and as of 2011 were expected to remain essentially constant at a level of 135 million, while deaths numbered 56 million per year and were expected to increase to 80 million per year by 2040. The median age of the world's population was estimated to be 30.4 years in 2018.
|
||||
NumberExampleB:
|
||||
value: 9007199254740991
|
||||
summary: "Number.MAX_SAFE_INTEGER"
|
||||
description: |
|
||||
The `MAX_SAFE_INTEGER` constant has a value of `9007199254740991` (9,007,199,254,740,991 or ~9 quadrillion). The reasoning behind that number is that JavaScript uses double-precision floating-point format numbers as specified in IEEE 754 and can only safely represent numbers between `-(2^53 - 1)` and `2^53 - 1`.
|
||||
|
||||
Safe in this context refers to the ability to represent integers exactly and to correctly compare them. For example, `Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2` will evaluate to `true`, which is mathematically incorrect. See `Number.isSafeInteger()` for more information.
|
||||
|
||||
Because `MAX_SAFE_INTEGER` is a static property of `Number`, you always use it as `Number.MAX_SAFE_INTEGER`, rather than as a property of a `Number` object you created.
|
||||
NumberExampleC:
|
||||
# `description` and `summary` intentionally omitted
|
||||
value: 0
|
||||
BooleanExampleA:
|
||||
value: true
|
||||
summary: The truth will set you free
|
||||
description: |
|
||||
In some programming languages, any expression can be evaluated in a context that expects a Boolean data type. Typically (though this varies by programming language) expressions like the number zero, the empty string, empty lists, and null evaluate to false, and strings with content (like "abc"), other numbers, and objects evaluate to true. Sometimes these classes of expressions are called "truthy" and "falsey".
|
||||
BooleanExampleB:
|
||||
# `description` intentionally omitted
|
||||
value: false
|
||||
summary: Friends don't lie to friends
|
||||
ArrayExampleA:
|
||||
value: [a, b, c]
|
||||
summary: A lowly array of strings
|
||||
description: |
|
||||
In computer science, a list or sequence is an abstract data type that represents a countable number of ordered values, where the same value may occur more than once. An instance of a list is a computer representation of the mathematical concept of a finite sequence; the (potentially) infinite analog of a list is a stream.[1]:§3.5 Lists are a basic example of containers, as they contain other values. If the same value occurs multiple times, each occurrence is considered a distinct item.
|
||||
ArrayExampleB:
|
||||
value: [1, 2, 3, 4]
|
||||
summary: A lowly array of numbers
|
||||
description: |
|
||||
Many programming languages provide support for list data types, and have special syntax and semantics for lists and list operations. A list can often be constructed by writing the items in sequence, separated by commas, semicolons, and/or spaces, within a pair of delimiters such as parentheses '()', brackets '[]', braces '{}', or angle brackets '<>'. Some languages may allow list types to be indexed or sliced like array types, in which case the data type is more accurately described as an array. In object-oriented programming languages, lists are usually provided as instances of subclasses of a generic "list" class, and traversed via separate iterators. List data types are often implemented using array data structures or linked lists of some sort, but other data structures may be more appropriate for some applications. In some contexts, such as in Lisp programming, the term list may refer specifically to a linked list rather than an array.
|
||||
|
||||
In type theory and functional programming, abstract lists are usually defined inductively by two operations: nil that yields the empty list, and cons, which adds an item at the beginning of a list.
|
||||
ArrayExampleC:
|
||||
# `summary` intentionally omitted
|
||||
value: []
|
||||
description: An empty array value should clear the current value
|
||||
ObjectExampleA:
|
||||
value:
|
||||
firstName: Kyle
|
||||
lastName: Shockey
|
||||
email: kyle.shockey@smartbear.com
|
||||
summary: A user's contact info
|
||||
description: Who is this guy, anyways?
|
||||
ObjectExampleB:
|
||||
value:
|
||||
name: Abbey
|
||||
type: kitten
|
||||
color: calico
|
||||
gender: female
|
||||
age: 11 weeks
|
||||
summary: A wonderful kitten's info
|
||||
description: |
|
||||
Today’s domestic cats are physically very similar to their wild
|
||||
ancestors. “Domestic cats and wildcats share a majority of their
|
||||
characteristics,” Lyons says, but there are a few key differences:
|
||||
wildcats were and are typically larger than their domestic kin, with
|
||||
brown, tabby-like fur. “Wildcats have to have camouflage that’s going to
|
||||
keep them very inconspicuous in the wild,” Lyons says. “So you can’t
|
||||
have cats with orange and white running around—they’re going to be
|
||||
snatched up by their predators.” As cats were domesticated, they began
|
||||
to be selected and bred for more interesting colorations, thus giving us
|
||||
today’s range of beautiful cat breeds.
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
openapi: 3.0.0
|
||||
info:
|
||||
title: Switching between multiple content-type test
|
||||
version: 1.0.0
|
||||
servers:
|
||||
- url: https://httpbin.org
|
||||
paths:
|
||||
/post:
|
||||
post:
|
||||
requestBody:
|
||||
content:
|
||||
multipart/form-data:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Bar'
|
||||
application/x-www-form-urlencoded:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Foo'
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/FooBar'
|
||||
responses:
|
||||
'200':
|
||||
description: ok
|
||||
|
||||
components:
|
||||
schemas:
|
||||
Foo:
|
||||
type: object
|
||||
properties:
|
||||
foo:
|
||||
type: string
|
||||
example: ''
|
||||
Bar:
|
||||
type: object
|
||||
required: [bar]
|
||||
properties:
|
||||
bar:
|
||||
type: integer
|
||||
example: 1
|
||||
FooBar:
|
||||
type: object
|
||||
required:
|
||||
- bar
|
||||
properties:
|
||||
foo:
|
||||
type: string
|
||||
example: ''
|
||||
bar:
|
||||
type: integer
|
||||
example: 1
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
openapi: 3.0.2
|
||||
servers:
|
||||
- url: /test-url-switch-1
|
||||
- url: /test-url-switch-2
|
||||
info:
|
||||
title: multi-server test, switch
|
||||
version: 0.0.1
|
||||
description: |-
|
||||
a simple test to select different servers
|
||||
paths:
|
||||
/:
|
||||
get:
|
||||
summary: an operation
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
openapi: 3.0.2
|
||||
servers:
|
||||
- url: /test-url-1
|
||||
- url: /test-url-2
|
||||
info:
|
||||
title: multi-server test
|
||||
version: 0.0.1
|
||||
description: |-
|
||||
a simple test to select different servers
|
||||
paths:
|
||||
/:
|
||||
get:
|
||||
summary: an operation
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
@@ -0,0 +1,309 @@
|
||||
{
|
||||
"openapi": "3.0.0",
|
||||
"info": {
|
||||
"version": "1.0.0",
|
||||
"title": "XML definition with oneOf & anyOf",
|
||||
"description": "Definition to cover multiple XML examples"
|
||||
},
|
||||
"paths": {
|
||||
"/foo": {
|
||||
"post": {
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"text/xml": {
|
||||
"schema": {
|
||||
"description": "XML schema with oneOf for /foo request and mediaType text/xml",
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/OneOfOne"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/OneOfTwo"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/OneOfThree"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/OneOfFour"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"application/xml": {
|
||||
"schema": {
|
||||
"description": "fallback XML schema with mediaType application/xml",
|
||||
"$ref": "#/components/schemas/OneOfTwo"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"text/xml": {
|
||||
"schema": {
|
||||
"description": "XML schema with mediaType text/xml",
|
||||
"$ref": "#/components/schemas/foobarResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/bar": {
|
||||
"post": {
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"text/xml": {
|
||||
"schema": {
|
||||
"description": "XML schema with anyOf for /bar request and mediaType text/xml",
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/OneOfOne"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/OneOfTwo"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/OneOfThree"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/OneOfFour"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"application/xml": {
|
||||
"schema": {
|
||||
"description": "fallback XML schema with mediaType application/xml",
|
||||
"$ref": "#/components/schemas/OneOfTwo"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"text/xml": {
|
||||
"schema": {
|
||||
"description": "XML schema with mediaType text/xml",
|
||||
"$ref": "#/components/schemas/foobarResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/foobar": {
|
||||
"post": {
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/xml": {
|
||||
"schema": {
|
||||
"description": "XML schema with oneOf for /foobar request and mediaType application/xml",
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/OneOfOne"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/OneOfTwo"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/OneOfThree"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/OneOfFour"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"text/xml": {
|
||||
"schema": {
|
||||
"description": "fallback XML schema with mediaType text/xml",
|
||||
"$ref": "#/components/schemas/OneOfThree"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"text/xml": {
|
||||
"schema": {
|
||||
"description": "XML schema with mediaType application/xml",
|
||||
"$ref": "#/components/schemas/foobarResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/barfoo": {
|
||||
"post": {
|
||||
"requestBody": {
|
||||
"content": {
|
||||
"application/xml": {
|
||||
"schema": {
|
||||
"description": "XML schema with anyOf for /barfoo request and mediaType application/xml",
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/OneOfOne"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/OneOfTwo"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/OneOfThree"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/OneOfFour"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"text/xml": {
|
||||
"schema": {
|
||||
"description": "fallback XML schema with mediaType text/xml",
|
||||
"$ref": "#/components/schemas/OneOfThree"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": true
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"content": {
|
||||
"application/xml": {
|
||||
"schema": {
|
||||
"description": "XML schema with mediaType application/xml",
|
||||
"$ref": "#/components/schemas/foobarResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"schemas": {
|
||||
"OneOfOne": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"Body": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"fooOne": {}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"xml": {
|
||||
"prefix": "soapenv"
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"xml": {
|
||||
"prefix": "soapenv",
|
||||
"namespace": "http://schemas.xmlsoap.org/soap/envelope/",
|
||||
"name": "Envelope"
|
||||
}
|
||||
},
|
||||
"OneOfTwo": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"Body": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"fooTwo": {}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"xml": {
|
||||
"prefix": "soapenv"
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"xml": {
|
||||
"prefix": "soapenv",
|
||||
"namespace": "http://schemas.xmlsoap.org/soap/envelope/",
|
||||
"name": "Envelope"
|
||||
}
|
||||
},
|
||||
"OneOfThree": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"Body": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"fooThree": {}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"xml": {
|
||||
"prefix": "soapenv"
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"xml": {
|
||||
"prefix": "soapenv",
|
||||
"namespace": "http://schemas.xmlsoap.org/soap/envelope/",
|
||||
"name": "Envelope"
|
||||
}
|
||||
},
|
||||
"OneOfFour": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"Body": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"fooFour": {}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"xml": {
|
||||
"prefix": "soapenv"
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"xml": {
|
||||
"prefix": "soapenv",
|
||||
"namespace": "http://schemas.xmlsoap.org/soap/envelope/",
|
||||
"name": "Envelope"
|
||||
}
|
||||
},
|
||||
"foobarResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"Body": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"foobarResObj": {
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"xml": {
|
||||
"prefix": "soapenv"
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"xml": {
|
||||
"prefix": "soapenv",
|
||||
"namespace": "http://schemas.xmlsoap.org/soap/envelope/",
|
||||
"name": "Envelope"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
openapi: 3.0.0
|
||||
info:
|
||||
title: test
|
||||
version: "1.0.0"
|
||||
paths:
|
||||
/example1:
|
||||
get:
|
||||
description: test fetching
|
||||
parameters:
|
||||
- in: query
|
||||
name: basicName
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
color:
|
||||
oneOf:
|
||||
- type: array # invalid definition b/c type: array is missing 'items'
|
||||
- type: string
|
||||
- type: integer
|
||||
responses:
|
||||
'200':
|
||||
description: successful fetch
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
openapi: 3.0.1
|
||||
info:
|
||||
title: Example Swagger
|
||||
version: '1.0'
|
||||
servers:
|
||||
- url: /api/v1
|
||||
paths:
|
||||
/test/{id}/related/{relatedId}:
|
||||
post:
|
||||
parameters:
|
||||
- in: path
|
||||
name: relatedId
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
default: 1
|
||||
description: The related ID
|
||||
- in: header
|
||||
name: TRACE-ID
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
default: 1
|
||||
description: The trace ID
|
||||
- in: cookie
|
||||
name: debug
|
||||
required: true
|
||||
schema:
|
||||
type: number
|
||||
enum:
|
||||
- 0
|
||||
- 1
|
||||
description: debug flag
|
||||
- in: header
|
||||
name: USER-ID
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
default: 1
|
||||
description: The user ID
|
||||
- in: query
|
||||
name: asc
|
||||
required: true
|
||||
schema:
|
||||
type: boolean
|
||||
default: true
|
||||
description: sort asc
|
||||
- in: path
|
||||
name: id
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
default: 1
|
||||
description: The ID
|
||||
requestBody:
|
||||
description: Some
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
200:
|
||||
description: Some
|
||||
+418
@@ -0,0 +1,418 @@
|
||||
openapi: 3.0.2
|
||||
servers:
|
||||
- url: /v3
|
||||
info:
|
||||
description: |-
|
||||
This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about
|
||||
Swagger at [http://swagger.io](http://swagger.io). In the third iteration of the pet store, we've switched to the design first approach!
|
||||
You can now help us improve the API whether it's by making changes to the definition itself or to the code.
|
||||
That way, with time, we can improve the API in general, and expose some of the new features in OAS3.
|
||||
|
||||
Some useful links:
|
||||
- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)
|
||||
- [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)
|
||||
version: 1.0.5-SNAPSHOT
|
||||
title: Swagger Petstore - OpenAPI 3.0
|
||||
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'
|
||||
tags:
|
||||
- name: pet
|
||||
description: Everything about your Pets
|
||||
externalDocs:
|
||||
description: Find out more
|
||||
url: 'http://swagger.io'
|
||||
paths:
|
||||
/pet:
|
||||
post:
|
||||
tags:
|
||||
- pet
|
||||
summary: Add a new pet to the store
|
||||
description: Add a new pet to the store
|
||||
operationId: addPet
|
||||
responses:
|
||||
'200':
|
||||
description: Successful operation
|
||||
content:
|
||||
application/xml:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
'405':
|
||||
description: Invalid input
|
||||
security:
|
||||
- petstore_auth:
|
||||
- 'write:pets'
|
||||
- 'read:pets'
|
||||
requestBody:
|
||||
description: Create a new pet in the store
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
application/xml:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
application/x-www-form-urlencoded:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
put:
|
||||
tags:
|
||||
- pet
|
||||
summary: Update an existing pet
|
||||
description: Update an existing pet by Id
|
||||
operationId: updatePet
|
||||
responses:
|
||||
'200':
|
||||
description: Successful operation
|
||||
content:
|
||||
application/xml:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
'400':
|
||||
description: Invalid ID supplied
|
||||
'404':
|
||||
description: Pet not found
|
||||
'405':
|
||||
description: Validation exception
|
||||
security:
|
||||
- petstore_auth:
|
||||
- 'write:pets'
|
||||
- 'read:pets'
|
||||
requestBody:
|
||||
description: Update an existent pet in the store
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
application/xml:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
application/x-www-form-urlencoded:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
/pet/findByStatus:
|
||||
get:
|
||||
tags:
|
||||
- pet
|
||||
summary: Finds Pets by status
|
||||
description: Multiple status values can be provided with comma separated strings
|
||||
operationId: findPetsByStatus
|
||||
parameters:
|
||||
- name: status
|
||||
in: query
|
||||
description: Status values that need to be considered for filter
|
||||
required: false
|
||||
explode: true
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- available
|
||||
- pending
|
||||
- sold
|
||||
default: available
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
application/xml:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
'400':
|
||||
description: Invalid status value
|
||||
security:
|
||||
- petstore_auth:
|
||||
- 'write:pets'
|
||||
- 'read:pets'
|
||||
/pet/findByTags:
|
||||
get:
|
||||
tags:
|
||||
- pet
|
||||
summary: Finds Pets by tags
|
||||
description: >-
|
||||
Multiple tags can be provided with comma separated strings. Use tag1,
|
||||
tag2, tag3 for testing.
|
||||
operationId: findPetsByTags
|
||||
parameters:
|
||||
- name: tags
|
||||
in: query
|
||||
description: Tags to filter by
|
||||
required: false
|
||||
explode: true
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
application/xml:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
'400':
|
||||
description: Invalid tag value
|
||||
security:
|
||||
- petstore_auth:
|
||||
- 'write:pets'
|
||||
- 'read:pets'
|
||||
'/pet/{petId}':
|
||||
get:
|
||||
tags:
|
||||
- pet
|
||||
summary: Find pet by ID
|
||||
description: Returns a single pet
|
||||
operationId: getPetById
|
||||
parameters:
|
||||
- name: petId
|
||||
in: path
|
||||
description: ID of pet to return
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
format: int64
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
application/xml:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
'400':
|
||||
description: Invalid ID supplied
|
||||
'404':
|
||||
description: Pet not found
|
||||
security:
|
||||
- api_key: []
|
||||
- petstore_auth:
|
||||
- 'write:pets'
|
||||
- 'read:pets'
|
||||
post:
|
||||
tags:
|
||||
- pet
|
||||
summary: Updates a pet in the store with form data
|
||||
description: ''
|
||||
operationId: updatePetWithForm
|
||||
parameters:
|
||||
- name: petId
|
||||
in: path
|
||||
description: ID of pet that needs to be updated
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
format: int64
|
||||
- name: name
|
||||
in: query
|
||||
description: Name of pet that needs to be updated
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- name: status
|
||||
in: query
|
||||
description: Status of pet that needs to be updated
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'405':
|
||||
description: Invalid input
|
||||
security:
|
||||
- petstore_auth:
|
||||
- 'write:pets'
|
||||
- 'read:pets'
|
||||
delete:
|
||||
tags:
|
||||
- pet
|
||||
summary: Deletes a pet
|
||||
description: ''
|
||||
operationId: deletePet
|
||||
parameters:
|
||||
- name: api_key
|
||||
in: header
|
||||
description: ''
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
- name: petId
|
||||
in: path
|
||||
description: Pet id to delete
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
format: int64
|
||||
responses:
|
||||
'400':
|
||||
description: Invalid pet value
|
||||
security:
|
||||
- petstore_auth:
|
||||
- 'write:pets'
|
||||
- 'read:pets'
|
||||
'/pet/{petId}/uploadImage':
|
||||
post:
|
||||
tags:
|
||||
- pet
|
||||
summary: uploads an image
|
||||
description: ''
|
||||
operationId: uploadFile
|
||||
parameters:
|
||||
- name: petId
|
||||
in: path
|
||||
description: ID of pet to update
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
format: int64
|
||||
- name: additionalMetadata
|
||||
in: query
|
||||
description: Additional Metadata
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ApiResponse'
|
||||
security:
|
||||
- petstore_auth:
|
||||
- 'write:pets'
|
||||
- 'read:pets'
|
||||
requestBody:
|
||||
content:
|
||||
application/octet-stream:
|
||||
schema:
|
||||
type: string
|
||||
format: binary
|
||||
externalDocs:
|
||||
description: Find out more about Swagger
|
||||
url: 'http://swagger.io'
|
||||
components:
|
||||
schemas:
|
||||
Category:
|
||||
x-swagger-router-model: io.swagger.petstore.model.Category
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
example: 1
|
||||
name:
|
||||
type: string
|
||||
example: Dogs
|
||||
xml:
|
||||
name: category
|
||||
type: object
|
||||
Tag:
|
||||
x-swagger-router-model: io.swagger.petstore.model.Tag
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
name:
|
||||
type: string
|
||||
xml:
|
||||
name: tag
|
||||
type: object
|
||||
Pet:
|
||||
x-swagger-router-model: io.swagger.petstore.model.Pet
|
||||
required:
|
||||
- name
|
||||
- photoUrls
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
example: 10
|
||||
name:
|
||||
type: string
|
||||
example: doggie
|
||||
category:
|
||||
$ref: '#/components/schemas/Category'
|
||||
photoUrls:
|
||||
type: array
|
||||
xml:
|
||||
wrapped: true
|
||||
items:
|
||||
type: string
|
||||
xml:
|
||||
name: photoUrl
|
||||
tags:
|
||||
type: array
|
||||
xml:
|
||||
wrapped: true
|
||||
items:
|
||||
$ref: '#/components/schemas/Tag'
|
||||
xml:
|
||||
name: tag
|
||||
status:
|
||||
type: string
|
||||
description: pet status in the store
|
||||
enum:
|
||||
- available
|
||||
- pending
|
||||
- sold
|
||||
xml:
|
||||
name: pet
|
||||
type: object
|
||||
ApiResponse:
|
||||
properties:
|
||||
code:
|
||||
type: integer
|
||||
format: int32
|
||||
type:
|
||||
type: string
|
||||
message:
|
||||
type: string
|
||||
xml:
|
||||
name: '##default'
|
||||
type: object
|
||||
requestBodies:
|
||||
Pet:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
application/xml:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
description: Pet object that needs to be added to the store
|
||||
securitySchemes:
|
||||
petstore_auth:
|
||||
type: oauth2
|
||||
flows:
|
||||
implicit:
|
||||
authorizationUrl: 'https://petstore.swagger.io/oauth/authorize'
|
||||
scopes:
|
||||
'write:pets': modify pets in your account
|
||||
'read:pets': read your pets
|
||||
api_key:
|
||||
type: apiKey
|
||||
name: api_key
|
||||
in: header
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
openapi: 3.0.0
|
||||
info:
|
||||
title: "Request body file upload"
|
||||
description: |-
|
||||
This document has examples for examining the `schema` or content type for request bodies requiring a file upload
|
||||
* `application/octect-stream` content type (no matter what schema format)
|
||||
* `audio/*` content type (no matter what schema format)
|
||||
* `image/*` content type (no matter what schema format)
|
||||
* `video/*` content type (no matter what schema format)
|
||||
* schema format is `base64` (no matter what content type)
|
||||
* schema format is `binary` (no matter what content type)
|
||||
version: "1.0.0"
|
||||
paths:
|
||||
/upload-application-octet-stream:
|
||||
post:
|
||||
operationId: uploadApplicationOctetStream
|
||||
requestBody:
|
||||
content:
|
||||
application/octet-stream:
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
/upload-image-png:
|
||||
post:
|
||||
operationId: uploadImagePng
|
||||
requestBody:
|
||||
content:
|
||||
image/png:
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
/upload-audio-wav:
|
||||
post:
|
||||
operationId: uploadAudioWav
|
||||
requestBody:
|
||||
content:
|
||||
audio/wav:
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
/upload-video-mpeg:
|
||||
post:
|
||||
operationId: uploadVideoMpeg
|
||||
requestBody:
|
||||
content:
|
||||
video/mpeg:
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
/upload-schema-format-binary:
|
||||
post:
|
||||
operationId: uploadSchemaFormatBinary
|
||||
requestBody:
|
||||
content:
|
||||
application/x-custom:
|
||||
schema:
|
||||
type: string
|
||||
format: binary
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
/upload-schema-format-base64:
|
||||
post:
|
||||
operationId: uploadSchemaFormatBase64
|
||||
requestBody:
|
||||
content:
|
||||
application/x-custom:
|
||||
schema:
|
||||
type: string
|
||||
format: base64
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: multipart/form-data schema object
|
||||
version: 0.0.1
|
||||
paths:
|
||||
/test:
|
||||
post:
|
||||
requestBody:
|
||||
content:
|
||||
multipart/form-data:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
file:
|
||||
type: string
|
||||
format: binary
|
||||
parameters:
|
||||
"$ref": "#/components/schemas/TestBody"
|
||||
responses:
|
||||
200:
|
||||
description: ok
|
||||
components:
|
||||
schemas:
|
||||
TestBody:
|
||||
type: object
|
||||
properties:
|
||||
stuff:
|
||||
type: string
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: asd
|
||||
version: 0.0.1
|
||||
paths:
|
||||
/test:
|
||||
post:
|
||||
requestBody:
|
||||
content:
|
||||
multipart/form-data:
|
||||
schema:
|
||||
$ref: '#/components/schemas/TestBody'
|
||||
responses:
|
||||
200:
|
||||
description: ok
|
||||
components:
|
||||
schemas:
|
||||
TestBody:
|
||||
required:
|
||||
- test_enum
|
||||
type: object
|
||||
properties:
|
||||
test_enum:
|
||||
allOf:
|
||||
- $ref: "#/components/schemas/TestEnum"
|
||||
TestEnum:
|
||||
enum:
|
||||
- A
|
||||
- B
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
openapi: "3.0.0"
|
||||
|
||||
paths:
|
||||
/:
|
||||
get:
|
||||
operationId: "myOperation"
|
||||
tags: ["myTag"]
|
||||
summary: an operation
|
||||
responses:
|
||||
'200':
|
||||
description: a pet to be returned
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
'404':
|
||||
x-error: true
|
||||
x-error-codes: [NOT_FOUND]
|
||||
description: Not found
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
swagger: "2.0"
|
||||
|
||||
paths:
|
||||
/:
|
||||
get:
|
||||
operationId: "myOperation"
|
||||
tags: ["myTag"]
|
||||
summary: an operation
|
||||
responses:
|
||||
"200":
|
||||
description: ok
|
||||
'404':
|
||||
x-error: true
|
||||
x-error-codes: [NOT_FOUND]
|
||||
description: Not found
|
||||
+339
@@ -0,0 +1,339 @@
|
||||
openapi: 3.0.0
|
||||
info:
|
||||
title: "Schema in Parameters"
|
||||
description: |-
|
||||
This document has examples for examining the `schema` within a set of parameters
|
||||
* String Enum (/pet/findByStatus)
|
||||
* Array of Strings (/pet/findByTags)
|
||||
* Array of Boolean (/petOwner/listOfServiceTrainer)
|
||||
* Array of Objects (/petOwners/createWithList)
|
||||
* Array of Enum (/petOwner/findByPreference)
|
||||
|
||||
This document also covers a debounce test for `schema` type `string
|
||||
* String (/petOwner)
|
||||
|
||||
This documents does not cover:
|
||||
* Array of Arrays
|
||||
|
||||
Additional notes
|
||||
* Provides additional coverage and examples not covered in the Multiple Examples Core Document (Test)
|
||||
* Code component reference `JsonSchemaForm`
|
||||
* `pet` and `tag` schemas are reduced from Swagger Petstore
|
||||
version: "1.0.0"
|
||||
paths:
|
||||
/pet/findByStatus:
|
||||
get:
|
||||
summary: Finds Pets by status
|
||||
description: Multiple status values can be provided with comma separated strings
|
||||
operationId: findPetsByStatus
|
||||
parameters:
|
||||
- name: status
|
||||
in: query
|
||||
description: Status values that need to be considered for filter
|
||||
required: false
|
||||
explode: true
|
||||
schema:
|
||||
type: string
|
||||
enum:
|
||||
- available
|
||||
- pending
|
||||
- sold
|
||||
default: available
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
application/xml:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
'400':
|
||||
description: Invalid status value
|
||||
security:
|
||||
- petstore_auth:
|
||||
- 'write:pets'
|
||||
- 'read:pets'
|
||||
/pet/findByTags:
|
||||
get:
|
||||
tags:
|
||||
- pet
|
||||
summary: Finds Pets by tags
|
||||
description: >-
|
||||
Multiple tags can be provided with comma separated strings. Use tag1,
|
||||
tag2, tag3 for testing.
|
||||
operationId: findPetsByTags
|
||||
parameters:
|
||||
- name: tags
|
||||
in: query
|
||||
description: Tags to filter by
|
||||
required: false
|
||||
explode: true
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
application/xml:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
'400':
|
||||
description: Invalid tag value
|
||||
security:
|
||||
- petstore_auth:
|
||||
- 'write:pets'
|
||||
- 'read:pets'
|
||||
'/petOwner/{petOwnerId}':
|
||||
get:
|
||||
tags:
|
||||
- petOwner
|
||||
summary: Find pet owner by ID
|
||||
description: Returns a single pet owner if ID found, list if no ID provided
|
||||
operationId: getPetOwnerById
|
||||
parameters:
|
||||
- name: petOwnerId
|
||||
in: path
|
||||
description: ID of pet owner to return
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
format: int64
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
application/xml:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PetOwner'
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/PetOwner'
|
||||
'400':
|
||||
description: Invalid ID supplied
|
||||
'404':
|
||||
description: Pet not found
|
||||
/petOwner/listOfServiceTrainer:
|
||||
get:
|
||||
tags:
|
||||
- petOwner
|
||||
summary: List of Service Trainers
|
||||
description: >-
|
||||
Expect boolean, but allow both true and false
|
||||
operationId: listOfServiceTrainer
|
||||
parameters:
|
||||
- name: tags
|
||||
in: query
|
||||
description: Boolean to filter by
|
||||
required: false
|
||||
explode: true
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: boolean
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
application/xml:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/PetOwner'
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/PetOwner'
|
||||
'400':
|
||||
description: Invalid tag value
|
||||
/petOwner/findByPreference:
|
||||
get:
|
||||
tags:
|
||||
- petOwner
|
||||
summary: Find by Pet Owner Preferences
|
||||
description: >-
|
||||
Expect enum
|
||||
operationId: findByPreference
|
||||
parameters:
|
||||
- name: tags
|
||||
in: query
|
||||
description: Enum to filter by
|
||||
required: false
|
||||
explode: true
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
enum:
|
||||
- dog
|
||||
- cat
|
||||
- bird
|
||||
- fish
|
||||
- other
|
||||
default: dog
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
application/xml:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/PetOwner'
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/PetOwner'
|
||||
'400':
|
||||
description: Invalid tag value
|
||||
components:
|
||||
/petOwner/createWithList:
|
||||
post:
|
||||
tags:
|
||||
- petOwner
|
||||
summary: Creates list of pet owners with given input array
|
||||
operationId: petOwnerCreateWithList
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/PetOwner'
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
content:
|
||||
application/xml:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/PetOwner'
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/PetOwner'
|
||||
'400':
|
||||
description: Invalid values
|
||||
schemas:
|
||||
Pet:
|
||||
x-swagger-router-model: io.swagger.petstore.model.Pet
|
||||
required:
|
||||
- name
|
||||
- photoUrls
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
example: 10
|
||||
name:
|
||||
type: string
|
||||
example: doggie
|
||||
# remove category property
|
||||
petOwners:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/PetOwner'
|
||||
photoUrls:
|
||||
type: array
|
||||
xml:
|
||||
wrapped: true
|
||||
items:
|
||||
type: string
|
||||
xml:
|
||||
name: photoUrl
|
||||
tags:
|
||||
type: array
|
||||
xml:
|
||||
wrapped: true
|
||||
items:
|
||||
$ref: '#/components/schemas/Tag'
|
||||
xml:
|
||||
name: tag
|
||||
status:
|
||||
type: string
|
||||
description: pet status in the store
|
||||
enum:
|
||||
- available
|
||||
- pending
|
||||
- sold
|
||||
xml:
|
||||
name: pet
|
||||
type: object
|
||||
# remove ApiResponse
|
||||
PetOwner:
|
||||
type: "object"
|
||||
properties:
|
||||
id:
|
||||
type: "integer"
|
||||
format: "int64"
|
||||
example: 10
|
||||
petId:
|
||||
type: "integer"
|
||||
format: "int64"
|
||||
example: 201
|
||||
petOwnerFirstName:
|
||||
type: "string"
|
||||
example: "John"
|
||||
petOwnerLastName:
|
||||
type: "string"
|
||||
example: "Smith"
|
||||
petOwnerContact:
|
||||
type: "string"
|
||||
example: "john.smith@fakeemail.co"
|
||||
petOwnerStatus:
|
||||
type: "integer"
|
||||
format: "int32"
|
||||
description: "Pet Owner Status"
|
||||
example: 302
|
||||
petOwnerPreferences:
|
||||
type: "string"
|
||||
description: "Pet Owner Preferred Pet Types"
|
||||
enum:
|
||||
- "dog"
|
||||
- "cat"
|
||||
- "bird"
|
||||
- "fish"
|
||||
- "other"
|
||||
petOwnerServiceTrainer:
|
||||
type: "boolean"
|
||||
description: "Pet Onwer is Service Trainer"
|
||||
default: false
|
||||
Tag:
|
||||
x-swagger-router-model: io.swagger.petstore.model.Tag
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
name:
|
||||
type: string
|
||||
xml:
|
||||
name: tag
|
||||
type: object
|
||||
requestBodies:
|
||||
Pet:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
application/xml:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
description: Pet object that needs to be added to the store
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
swagger: "2.0"
|
||||
info:
|
||||
description: "Test Required Enum and Boolean with Execute"
|
||||
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"
|
||||
schemes:
|
||||
- "https"
|
||||
- "http"
|
||||
paths:
|
||||
/pet/findByStatus:
|
||||
get:
|
||||
tags:
|
||||
- "pet"
|
||||
summary: "Finds Pets by status"
|
||||
description: "Multiple status values can be provided with comma separated strings"
|
||||
operationId: "findPetsByStatus"
|
||||
produces:
|
||||
- "application/xml"
|
||||
- "application/json"
|
||||
parameters:
|
||||
- name: "status"
|
||||
in: "query"
|
||||
description: "Status values that need to be considered for filter"
|
||||
required: true
|
||||
type: "array"
|
||||
items:
|
||||
type: "string"
|
||||
enum:
|
||||
- "available"
|
||||
- "pending"
|
||||
- "sold"
|
||||
default: "available"
|
||||
collectionFormat: "multi"
|
||||
- name: "expectIsOptional"
|
||||
in: "query"
|
||||
description: "this field should be optional"
|
||||
required: false
|
||||
type: boolean
|
||||
- name: "expectIsRequired"
|
||||
in: "query"
|
||||
description: "this field should be required"
|
||||
required: true
|
||||
type: boolean
|
||||
responses:
|
||||
"200":
|
||||
description: "successful operation"
|
||||
schema:
|
||||
type: "array"
|
||||
items:
|
||||
$ref: "#/definitions/Pet"
|
||||
"400":
|
||||
description: "Invalid status value"
|
||||
definitions:
|
||||
Pet:
|
||||
type: "object"
|
||||
required:
|
||||
- "name"
|
||||
properties:
|
||||
id:
|
||||
type: "integer"
|
||||
format: "int64"
|
||||
name:
|
||||
type: "string"
|
||||
example: "doggie"
|
||||
status:
|
||||
type: "string"
|
||||
description: "pet status in the store"
|
||||
enum:
|
||||
- "available"
|
||||
- "pending"
|
||||
- "sold"
|
||||
xml:
|
||||
name: "Pet"
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
openapi: 3.0.0
|
||||
info:
|
||||
description: No type for schema
|
||||
version: "1"
|
||||
title: "No type"
|
||||
paths:
|
||||
/case-one-no-schema:
|
||||
parameters:
|
||||
- name: namespace
|
||||
description: The custom resource's namespace
|
||||
# schema:
|
||||
in: path
|
||||
required: true
|
||||
get:
|
||||
description: sf
|
||||
responses:
|
||||
default:
|
||||
description: one
|
||||
/case-one-no-type-or-format:
|
||||
parameters:
|
||||
- name: namespace
|
||||
description: The custom resource's namespace
|
||||
schema:
|
||||
in: path
|
||||
required: true
|
||||
get:
|
||||
description: sf
|
||||
responses:
|
||||
default:
|
||||
description: one
|
||||
/case-one-type-only-no-format:
|
||||
parameters:
|
||||
- name: namespace
|
||||
description: The custom resource's namespace
|
||||
schema:
|
||||
type: integer
|
||||
in: path
|
||||
required: true
|
||||
get:
|
||||
description: sf
|
||||
responses:
|
||||
default:
|
||||
description: one
|
||||
/case-one-format-only-no-type:
|
||||
parameters:
|
||||
- name: namespace
|
||||
description: The custom resource's namespace
|
||||
schema:
|
||||
format: int64
|
||||
in: path
|
||||
required: true
|
||||
get:
|
||||
description: sf
|
||||
responses:
|
||||
default:
|
||||
description: one
|
||||
/case-two-no-schema:
|
||||
get:
|
||||
description: sf
|
||||
responses:
|
||||
default:
|
||||
description: one
|
||||
parameters:
|
||||
- name: namespace
|
||||
in: path
|
||||
description: The custom resource's namespace
|
||||
required: true
|
||||
# schema:
|
||||
/case-two-no-type-or-format:
|
||||
get:
|
||||
description: sf
|
||||
responses:
|
||||
default:
|
||||
description: one
|
||||
parameters:
|
||||
- name: namespace
|
||||
in: path
|
||||
description: The custom resource's namespace
|
||||
required: true
|
||||
schema:
|
||||
/case-two-type-only-no-format:
|
||||
get:
|
||||
description: sf
|
||||
responses:
|
||||
default:
|
||||
description: one
|
||||
parameters:
|
||||
- name: namespace
|
||||
in: path
|
||||
description: The custom resource's namespace
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
/case-two-format-only-no-type:
|
||||
get:
|
||||
description: sf
|
||||
responses:
|
||||
default:
|
||||
description: one
|
||||
parameters:
|
||||
- name: namespace
|
||||
in: path
|
||||
description: The custom resource's namespace
|
||||
required: true
|
||||
schema:
|
||||
format: int64
|
||||
/case-two-not-a-real-type:
|
||||
get:
|
||||
description: sf
|
||||
responses:
|
||||
default:
|
||||
description: one
|
||||
parameters:
|
||||
- name: namespace
|
||||
in: path
|
||||
description: The custom resource's namespace
|
||||
required: true
|
||||
schema:
|
||||
type: "NotARealType"
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
openapi: 3.0.0
|
||||
|
||||
info:
|
||||
version: 1.0.0
|
||||
title: Native date formats in YAML
|
||||
|
||||
paths:
|
||||
/foo:
|
||||
get:
|
||||
description: Has date without quotes
|
||||
responses:
|
||||
'200':
|
||||
description: Ok
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
without-quotes:
|
||||
type: string
|
||||
format: date
|
||||
example: 1999-11-31
|
||||
with-quotes:
|
||||
type: string
|
||||
format: date
|
||||
example: "1999-12-31"
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
swagger: '2.0'
|
||||
info:
|
||||
description: sample OAS 2 definition to test syntax highlighting
|
||||
version: 1.0.0
|
||||
title: json syntax highlighting
|
||||
host: "localhost:3200"
|
||||
basePath: /v1
|
||||
schemes:
|
||||
- https
|
||||
- http
|
||||
paths:
|
||||
/setServices:
|
||||
post:
|
||||
summary: "simple service"
|
||||
produces:
|
||||
- application/json
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/setServicesBody'
|
||||
responses:
|
||||
200:
|
||||
description: OK
|
||||
schema:
|
||||
$ref: '#/definitions/setServicesResponse'
|
||||
404:
|
||||
description: "Page not found"
|
||||
definitions:
|
||||
setServicesBody:
|
||||
type: object
|
||||
required:
|
||||
- appid
|
||||
- key
|
||||
- userid
|
||||
- station_objectid
|
||||
- details
|
||||
properties:
|
||||
appid:
|
||||
type: string
|
||||
example: "Website"
|
||||
description: "application ID"
|
||||
userid:
|
||||
type: integer
|
||||
example: "79daf5b4-aa4b-1452-eae5-42c231477ba7"
|
||||
description: "user id available to test"
|
||||
station_objectid:
|
||||
type: string
|
||||
example: "22a124b4-594b-4452-bdf5-fc3ef1477ba7"
|
||||
description: "station id available to test"
|
||||
details:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
station_serviceid:
|
||||
type: integer
|
||||
example: "34"
|
||||
description: "optional service id"
|
||||
name:
|
||||
type: string
|
||||
example: "hooray"
|
||||
amount:
|
||||
type: string
|
||||
example: "0.00"
|
||||
quantity:
|
||||
type: integer
|
||||
example: "999999"
|
||||
date:
|
||||
type: string
|
||||
format: date-time
|
||||
example: "2020-11-12 18:52:29"
|
||||
setServicesResponse:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
type: boolean
|
||||
example: true
|
||||
count:
|
||||
type: boolean
|
||||
example: 1
|
||||
response:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
type: integer
|
||||
example: 200
|
||||
station_serviceid:
|
||||
type: integer
|
||||
example: "3"
|
||||
userid:
|
||||
type: integer
|
||||
example: "5ff06f632bb165394501b05d3a833355"
|
||||
statusId:
|
||||
type: string
|
||||
example: "f0009babde9dbe204540d79cf754408e"
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
openapi: 3.0.1
|
||||
info:
|
||||
title: json syntax highlighting
|
||||
description: sample OAS 3 definition to test syntax highlighting
|
||||
version: 1.0.0
|
||||
servers:
|
||||
- url: https://localhost:3200/v1
|
||||
- url: http://localhost:3200/v1
|
||||
paths:
|
||||
/setServices:
|
||||
post:
|
||||
summary: simple service
|
||||
requestBody:
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
$ref: '#/components/schemas/setServicesBody'
|
||||
required: true
|
||||
responses:
|
||||
200:
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/setServicesResponse'
|
||||
404:
|
||||
description: Page not found
|
||||
content: {}
|
||||
x-codegen-request-body-name: body
|
||||
components:
|
||||
schemas:
|
||||
setServicesBody:
|
||||
required:
|
||||
- appid
|
||||
- details
|
||||
- station_objectid
|
||||
- userid
|
||||
type: object
|
||||
properties:
|
||||
appid:
|
||||
type: string
|
||||
description: application ID
|
||||
example: Website
|
||||
userid:
|
||||
type: integer
|
||||
description: user id available to test
|
||||
station_objectid:
|
||||
type: string
|
||||
description: station id available to test
|
||||
example: 22a124b4-594b-4452-bdf5-fc3ef1477ba7
|
||||
details:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
station_serviceid:
|
||||
type: integer
|
||||
description: optional service id
|
||||
example: 34
|
||||
name:
|
||||
type: string
|
||||
example: hooray
|
||||
amount:
|
||||
type: string
|
||||
example: "0.00"
|
||||
quantity:
|
||||
type: integer
|
||||
example: 999999
|
||||
date:
|
||||
type: string
|
||||
format: date-time
|
||||
setServicesResponse:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
type: boolean
|
||||
example: true
|
||||
count:
|
||||
type: boolean
|
||||
example: false
|
||||
response:
|
||||
type: object
|
||||
properties:
|
||||
status:
|
||||
type: integer
|
||||
example: 200
|
||||
station_serviceid:
|
||||
type: integer
|
||||
example: 3
|
||||
userid:
|
||||
type: integer
|
||||
statusId:
|
||||
type: string
|
||||
example: f0009babde9dbe204540d79cf754408e
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
openapi: 3.0.2
|
||||
info:
|
||||
title: try it out enabled test
|
||||
version: 0.0.1
|
||||
description: |-
|
||||
a simple test to ensure tryItOutEnabled=true expands "Try it out"
|
||||
paths:
|
||||
/:
|
||||
get:
|
||||
summary: an operation
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
swagger: '2.0'
|
||||
info:
|
||||
version: '1.0'
|
||||
title: "schema required properties should not be treated like required: true"
|
||||
paths:
|
||||
'/v1/any-path':
|
||||
put:
|
||||
summary: lorem
|
||||
operationId: setDeliveryLocation
|
||||
produces:
|
||||
- application/json
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
description: ipsum
|
||||
required: false
|
||||
schema:
|
||||
$ref: '#/definitions/TopModel'
|
||||
responses:
|
||||
'200':
|
||||
description: successful operation
|
||||
definitions:
|
||||
TopModel:
|
||||
type: object
|
||||
properties:
|
||||
testProperty:
|
||||
$ref: '#/definitions/NestedModel'
|
||||
NestedModel:
|
||||
type: object
|
||||
required:
|
||||
- validated
|
||||
properties:
|
||||
validated:
|
||||
type: boolean
|
||||
@@ -0,0 +1,12 @@
|
||||
swagger: "2.0"
|
||||
|
||||
info:
|
||||
title: One
|
||||
|
||||
paths:
|
||||
/:
|
||||
get:
|
||||
summary: an operation
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
@@ -0,0 +1,12 @@
|
||||
openapi: "3.0.0"
|
||||
|
||||
info:
|
||||
title: Two
|
||||
|
||||
paths:
|
||||
/:
|
||||
get:
|
||||
summary: an operation
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
openapi: 3.0.1
|
||||
info:
|
||||
title: Server Variables - One
|
||||
description: sample OAS 3 definition to test server variables with urls
|
||||
version: 1.0.0
|
||||
servers:
|
||||
- url: "https://localhost:3200{basePath}"
|
||||
variables:
|
||||
basePath:
|
||||
default: "/oneFirstUrl"
|
||||
- url: "http://localhost:3201{basePath}"
|
||||
variables:
|
||||
basePath:
|
||||
default: "/oneSecondUrl"
|
||||
paths:
|
||||
/a:
|
||||
post:
|
||||
summary: simple service A
|
||||
requestBody:
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
properties:
|
||||
foo:
|
||||
type: string
|
||||
bar:
|
||||
type: string
|
||||
required:
|
||||
- foo
|
||||
type: object
|
||||
required: true
|
||||
responses:
|
||||
200:
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: 'string'
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
openapi: 3.0.1
|
||||
info:
|
||||
title: Server Variables - Two
|
||||
description: sample OAS 3 definition to test server variables with urls
|
||||
version: 1.0.0
|
||||
servers:
|
||||
- url: "https://localhost:3200{basePath}"
|
||||
variables:
|
||||
basePath:
|
||||
default: "/twoFirstUrl"
|
||||
- url: "http://localhost:3201{basePath}"
|
||||
variables:
|
||||
basePath:
|
||||
default: "/twoSecondUrl"
|
||||
paths:
|
||||
/b:
|
||||
post:
|
||||
summary: simple service B
|
||||
requestBody:
|
||||
content:
|
||||
'application/json':
|
||||
schema:
|
||||
properties:
|
||||
foo:
|
||||
type: string
|
||||
bar:
|
||||
type: string
|
||||
required:
|
||||
- foo
|
||||
type: object
|
||||
required: true
|
||||
responses:
|
||||
200:
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: 'string'
|
||||
Reference in New Issue
Block a user