Update default value, fix example value (#370)

* fix python flask NPE with oas3

* update perl default value, fix example value

* update android sample, fix example value

* restore x-swagger-router-controller for nodejs server generator

* update default value for bash client, fix example value, invalid tag

* update default value for objc

* update objc pestore core data
This commit is contained in:
William Cheng
2018-05-08 19:51:15 +08:00
committed by GitHub
parent fd3b883e80
commit 0d20f75afc
61 changed files with 475 additions and 571 deletions

View File

@@ -1,4 +1,4 @@
openapi: 3.0.1
openapi: 3.0.0
info:
title: OpenAPI Petstore
description: This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
@@ -6,6 +6,9 @@ info:
name: Apache-2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 1.0.0
externalDocs:
description: Find out more about Swagger
url: http://swagger.io
servers:
- url: http://petstore.swagger.io/v2
tags:
@@ -23,25 +26,14 @@ paths:
summary: Update an existing pet
operationId: update_pet
requestBody:
description: Pet object that needs to be added to the store
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
application/xml:
schema:
$ref: '#/components/schemas/Pet'
required: true
$ref: '#/components/requestBodies/Pet'
responses:
400:
description: Invalid ID supplied
content: {}
404:
description: Pet not found
content: {}
405:
description: Validation exception
content: {}
security:
- petstore_auth:
- write:pets
@@ -53,19 +45,10 @@ paths:
summary: Add a new pet to the store
operationId: add_pet
requestBody:
description: Pet object that needs to be added to the store
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
application/xml:
schema:
$ref: '#/components/schemas/Pet'
required: true
$ref: '#/components/requestBodies/Pet'
responses:
405:
description: Invalid input
content: {}
security:
- petstore_auth:
- write:pets
@@ -83,6 +66,7 @@ paths:
in: query
description: Status values that need to be considered for filter
required: true
style: form
explode: false
schema:
type: array
@@ -109,7 +93,6 @@ paths:
$ref: '#/components/schemas/Pet'
400:
description: Invalid status value
content: {}
security:
- petstore_auth:
- write:pets
@@ -127,6 +110,7 @@ paths:
in: query
description: Tags to filter by
required: true
style: form
explode: false
schema:
type: array
@@ -148,7 +132,6 @@ paths:
$ref: '#/components/schemas/Pet'
400:
description: Invalid tag value
content: {}
deprecated: true
security:
- petstore_auth:
@@ -167,6 +150,8 @@ paths:
in: path
description: ID of pet to return
required: true
style: simple
explode: false
schema:
type: integer
format: int64
@@ -182,10 +167,8 @@ paths:
$ref: '#/components/schemas/Pet'
400:
description: Invalid ID supplied
content: {}
404:
description: Pet not found
content: {}
security:
- api_key: []
x-openapi-router-controller: openapi_server.controllers.pet_controller
@@ -199,6 +182,8 @@ paths:
in: path
description: ID of pet that needs to be updated
required: true
style: simple
explode: false
schema:
type: integer
format: int64
@@ -206,17 +191,10 @@ paths:
content:
application/x-www-form-urlencoded:
schema:
properties:
name:
type: string
description: Updated name of the pet
status:
type: string
description: Updated status of the pet
$ref: '#/components/schemas/body'
responses:
405:
description: Invalid input
content: {}
security:
- petstore_auth:
- write:pets
@@ -230,19 +208,23 @@ paths:
parameters:
- name: api_key
in: header
required: false
style: simple
explode: false
schema:
type: string
- name: petId
in: path
description: Pet id to delete
required: true
style: simple
explode: false
schema:
type: integer
format: int64
responses:
400:
description: Invalid pet value
content: {}
security:
- petstore_auth:
- write:pets
@@ -259,6 +241,8 @@ paths:
in: path
description: ID of pet to update
required: true
style: simple
explode: false
schema:
type: integer
format: int64
@@ -266,14 +250,7 @@ paths:
content:
multipart/form-data:
schema:
properties:
additionalMetadata:
type: string
description: Additional data to pass to server
file:
type: string
description: file to upload
format: binary
$ref: '#/components/schemas/body_1'
responses:
200:
description: successful operation
@@ -315,7 +292,7 @@ paths:
requestBody:
description: order placed for purchasing the pet
content:
'*/*':
application/json:
schema:
$ref: '#/components/schemas/Order'
required: true
@@ -331,7 +308,6 @@ paths:
$ref: '#/components/schemas/Order'
400:
description: Invalid Order
content: {}
x-openapi-router-controller: openapi_server.controllers.store_controller
/store/order/{orderId}:
get:
@@ -345,6 +321,8 @@ paths:
in: path
description: ID of pet that needs to be fetched
required: true
style: simple
explode: false
schema:
maximum: 5
minimum: 1
@@ -362,10 +340,8 @@ paths:
$ref: '#/components/schemas/Order'
400:
description: Invalid ID supplied
content: {}
404:
description: Order not found
content: {}
x-openapi-router-controller: openapi_server.controllers.store_controller
delete:
tags:
@@ -378,15 +354,15 @@ paths:
in: path
description: ID of the order that needs to be deleted
required: true
style: simple
explode: false
schema:
type: string
responses:
400:
description: Invalid ID supplied
content: {}
404:
description: Order not found
content: {}
x-openapi-router-controller: openapi_server.controllers.store_controller
/user:
post:
@@ -398,14 +374,13 @@ paths:
requestBody:
description: Created user object
content:
'*/*':
application/json:
schema:
$ref: '#/components/schemas/User'
required: true
responses:
default:
description: successful operation
content: {}
x-openapi-router-controller: openapi_server.controllers.user_controller
/user/createWithArray:
post:
@@ -414,18 +389,10 @@ paths:
summary: Creates list of users with given input array
operationId: create_users_with_array_input
requestBody:
description: List of user object
content:
'*/*':
schema:
type: array
items:
$ref: '#/components/schemas/User'
required: true
$ref: '#/components/requestBodies/UserArray'
responses:
default:
description: successful operation
content: {}
x-openapi-router-controller: openapi_server.controllers.user_controller
/user/createWithList:
post:
@@ -434,18 +401,10 @@ paths:
summary: Creates list of users with given input array
operationId: create_users_with_list_input
requestBody:
description: List of user object
content:
'*/*':
schema:
type: array
items:
$ref: '#/components/schemas/User'
required: true
$ref: '#/components/requestBodies/UserArray'
responses:
default:
description: successful operation
content: {}
x-openapi-router-controller: openapi_server.controllers.user_controller
/user/login:
get:
@@ -458,12 +417,16 @@ paths:
in: query
description: The user name for login
required: true
style: form
explode: true
schema:
type: string
- name: password
in: query
description: The password for login in clear text
required: true
style: form
explode: true
schema:
type: string
responses:
@@ -472,11 +435,15 @@ paths:
headers:
X-Rate-Limit:
description: calls per hour allowed by the user
style: simple
explode: false
schema:
type: integer
format: int32
X-Expires-After:
description: date in UTC when toekn expires
style: simple
explode: false
schema:
type: string
format: date-time
@@ -489,7 +456,6 @@ paths:
type: string
400:
description: Invalid username/password supplied
content: {}
x-openapi-router-controller: openapi_server.controllers.user_controller
/user/logout:
get:
@@ -500,7 +466,6 @@ paths:
responses:
default:
description: successful operation
content: {}
x-openapi-router-controller: openapi_server.controllers.user_controller
/user/{username}:
get:
@@ -513,6 +478,8 @@ paths:
in: path
description: The name that needs to be fetched. Use user1 for testing.
required: true
style: simple
explode: false
schema:
type: string
responses:
@@ -527,10 +494,8 @@ paths:
$ref: '#/components/schemas/User'
400:
description: Invalid username supplied
content: {}
404:
description: User not found
content: {}
x-openapi-router-controller: openapi_server.controllers.user_controller
put:
tags:
@@ -543,22 +508,22 @@ paths:
in: path
description: name that need to be deleted
required: true
style: simple
explode: false
schema:
type: string
requestBody:
description: Updated user object
content:
'*/*':
application/json:
schema:
$ref: '#/components/schemas/User'
required: true
responses:
400:
description: Invalid user supplied
content: {}
404:
description: User not found
content: {}
x-openapi-router-controller: openapi_server.controllers.user_controller
delete:
tags:
@@ -571,15 +536,15 @@ paths:
in: path
description: The name that needs to be deleted
required: true
style: simple
explode: false
schema:
type: string
responses:
400:
description: Invalid username supplied
content: {}
404:
description: User not found
content: {}
x-openapi-router-controller: openapi_server.controllers.user_controller
components:
schemas:
@@ -754,6 +719,45 @@ components:
code: 0
type: type
message: message
body:
type: object
properties:
name:
type: string
description: Updated name of the pet
status:
type: string
description: Updated status of the pet
body_1:
type: object
properties:
additionalMetadata:
type: string
description: Additional data to pass to server
file:
type: string
description: file to upload
format: binary
requestBodies:
UserArray:
description: List of user object
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
required: true
Pet:
description: Pet object that needs to be added to the store
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
application/xml:
schema:
$ref: '#/components/schemas/Pet'
required: true
securitySchemes:
petstore_auth:
type: oauth2