forked from loafle/openapi-generator-original
Fix NPE when generating examples for parameter (object) (#12538)
* fix NPE when generating examples for parameter (object) * add new files
This commit is contained in:
parent
6869f3b0b9
commit
f52ee28215
@ -1,6 +1,6 @@
|
|||||||
generatorName: aspnetcore
|
generatorName: aspnetcore
|
||||||
outputDir: samples/server/petstore/aspnetcore-3.0
|
outputDir: samples/server/petstore/aspnetcore-3.0
|
||||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml
|
||||||
templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0
|
templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}'
|
packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}'
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
generatorName: aspnetcore
|
generatorName: aspnetcore
|
||||||
outputDir: samples/server/petstore/aspnetcore-3.1
|
outputDir: samples/server/petstore/aspnetcore-3.1
|
||||||
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml
|
||||||
templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0
|
templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}'
|
packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}'
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
generatorName: aspnetcore
|
generatorName: aspnetcore
|
||||||
outputDir: samples/server/petstore/aspnetcore-5.0
|
outputDir: samples/server/petstore/aspnetcore-5.0
|
||||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml
|
||||||
templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0
|
templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}'
|
packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}'
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
generatorName: aspnetcore
|
generatorName: aspnetcore
|
||||||
outputDir: samples/server/petstore/aspnetcore-6.0
|
outputDir: samples/server/petstore/aspnetcore-6.0
|
||||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
inputSpec: modules/openapi-generator/src/test/resources/3_0/aspnetcore/petstore.yaml
|
||||||
templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0
|
templateDir: modules/openapi-generator/src/main/resources/aspnetcore/3.0
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}'
|
packageGuid: '{3C799344-F285-4669-8FD5-7ED9B795D5C5}'
|
||||||
|
@ -1410,8 +1410,15 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
|||||||
} else {
|
} else {
|
||||||
example = "new List<" + p.items.dataType + ">()";
|
example = "new List<" + p.items.dataType + ">()";
|
||||||
}
|
}
|
||||||
|
} else if (Boolean.TRUE.equals(p.isModel)) {
|
||||||
|
example = "new " + p.dataType + "()";
|
||||||
} else if (Boolean.TRUE.equals(p.isMap)) {
|
} else if (Boolean.TRUE.equals(p.isMap)) {
|
||||||
example = "new Dictionary<String, " + p.items.dataType + ">";
|
if (p.items != null) {
|
||||||
|
example = "new Dictionary<String, " + p.items.dataType + ">";
|
||||||
|
} else {
|
||||||
|
// default to String if item is not defined
|
||||||
|
example = "new Dictionary<String, String>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
p.example = example;
|
p.example = example;
|
||||||
|
@ -0,0 +1,754 @@
|
|||||||
|
openapi: 3.0.0
|
||||||
|
servers:
|
||||||
|
- url: 'http://petstore.swagger.io/v2'
|
||||||
|
info:
|
||||||
|
description: >-
|
||||||
|
This is a sample server Petstore server. For this sample, you can use the api key
|
||||||
|
`special-key` to test the authorization filters.
|
||||||
|
version: 1.0.0
|
||||||
|
title: OpenAPI Petstore
|
||||||
|
license:
|
||||||
|
name: Apache-2.0
|
||||||
|
url: 'https://www.apache.org/licenses/LICENSE-2.0.html'
|
||||||
|
tags:
|
||||||
|
- name: pet
|
||||||
|
description: Everything about your Pets
|
||||||
|
- name: store
|
||||||
|
description: Access to Petstore orders
|
||||||
|
- name: user
|
||||||
|
description: Operations about user
|
||||||
|
paths:
|
||||||
|
/pet:
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- pet
|
||||||
|
summary: Add a new pet to the store
|
||||||
|
description: ''
|
||||||
|
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:
|
||||||
|
$ref: '#/components/requestBodies/Pet'
|
||||||
|
put:
|
||||||
|
tags:
|
||||||
|
- pet
|
||||||
|
summary: Update an existing pet
|
||||||
|
description: ''
|
||||||
|
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:
|
||||||
|
$ref: '#/components/requestBodies/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: true
|
||||||
|
style: form
|
||||||
|
explode: false
|
||||||
|
deprecated: true
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
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:
|
||||||
|
- '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: true
|
||||||
|
style: form
|
||||||
|
explode: false
|
||||||
|
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:
|
||||||
|
- 'read:pets'
|
||||||
|
deprecated: true
|
||||||
|
'/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: []
|
||||||
|
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
|
||||||
|
responses:
|
||||||
|
'405':
|
||||||
|
description: Invalid input
|
||||||
|
security:
|
||||||
|
- petstore_auth:
|
||||||
|
- 'write:pets'
|
||||||
|
- 'read:pets'
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/x-www-form-urlencoded:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
description: Updated name of the pet
|
||||||
|
type: string
|
||||||
|
status:
|
||||||
|
description: Updated status of the pet
|
||||||
|
type: string
|
||||||
|
delete:
|
||||||
|
tags:
|
||||||
|
- pet
|
||||||
|
summary: Deletes a pet
|
||||||
|
description: ''
|
||||||
|
operationId: deletePet
|
||||||
|
parameters:
|
||||||
|
- name: api_key
|
||||||
|
in: header
|
||||||
|
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
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: successful operation
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/ApiResponse'
|
||||||
|
security:
|
||||||
|
- petstore_auth:
|
||||||
|
- 'write:pets'
|
||||||
|
- 'read:pets'
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
multipart/form-data:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
additionalMetadata:
|
||||||
|
description: Additional data to pass to server
|
||||||
|
type: string
|
||||||
|
file:
|
||||||
|
description: file to upload
|
||||||
|
type: string
|
||||||
|
format: binary
|
||||||
|
/store/inventory:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- store
|
||||||
|
summary: Returns pet inventories by status
|
||||||
|
description: Returns a map of status codes to quantities
|
||||||
|
operationId: getInventory
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: successful operation
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
additionalProperties:
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
|
security:
|
||||||
|
- api_key: []
|
||||||
|
/store/order:
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- store
|
||||||
|
summary: Place an order for a pet
|
||||||
|
description: ''
|
||||||
|
operationId: placeOrder
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: successful operation
|
||||||
|
content:
|
||||||
|
application/xml:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Order'
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Order'
|
||||||
|
'400':
|
||||||
|
description: Invalid Order
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Order'
|
||||||
|
description: order placed for purchasing the pet
|
||||||
|
required: true
|
||||||
|
'/store/order/{orderId}':
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- store
|
||||||
|
summary: Find purchase order by ID
|
||||||
|
description: >-
|
||||||
|
For valid response try integer IDs with value <= 5 or > 10. Other values
|
||||||
|
will generated exceptions
|
||||||
|
operationId: getOrderById
|
||||||
|
parameters:
|
||||||
|
- name: orderId
|
||||||
|
in: path
|
||||||
|
description: ID of pet that needs to be fetched
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
minimum: 1
|
||||||
|
maximum: 5
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: successful operation
|
||||||
|
content:
|
||||||
|
application/xml:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Order'
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Order'
|
||||||
|
'400':
|
||||||
|
description: Invalid ID supplied
|
||||||
|
'404':
|
||||||
|
description: Order not found
|
||||||
|
delete:
|
||||||
|
tags:
|
||||||
|
- store
|
||||||
|
summary: Delete purchase order by ID
|
||||||
|
description: >-
|
||||||
|
For valid response try integer IDs with value < 1000. Anything above
|
||||||
|
1000 or nonintegers will generate API errors
|
||||||
|
operationId: deleteOrder
|
||||||
|
parameters:
|
||||||
|
- name: orderId
|
||||||
|
in: path
|
||||||
|
description: ID of the order that needs to be deleted
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
'400':
|
||||||
|
description: Invalid ID supplied
|
||||||
|
'404':
|
||||||
|
description: Order not found
|
||||||
|
/user:
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- user
|
||||||
|
summary: Create user
|
||||||
|
description: This can only be done by the logged in user.
|
||||||
|
operationId: createUser
|
||||||
|
responses:
|
||||||
|
default:
|
||||||
|
description: successful operation
|
||||||
|
security:
|
||||||
|
- api_key: []
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/User'
|
||||||
|
description: Created user object
|
||||||
|
required: true
|
||||||
|
/user/createWithArray:
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- user
|
||||||
|
summary: Creates list of users with given input array
|
||||||
|
description: ''
|
||||||
|
operationId: createUsersWithArrayInput
|
||||||
|
responses:
|
||||||
|
default:
|
||||||
|
description: successful operation
|
||||||
|
security:
|
||||||
|
- api_key: []
|
||||||
|
requestBody:
|
||||||
|
$ref: '#/components/requestBodies/UserArray'
|
||||||
|
/user/createWithList:
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- user
|
||||||
|
summary: Creates list of users with given input array
|
||||||
|
description: ''
|
||||||
|
operationId: createUsersWithListInput
|
||||||
|
responses:
|
||||||
|
default:
|
||||||
|
description: successful operation
|
||||||
|
security:
|
||||||
|
- api_key: []
|
||||||
|
requestBody:
|
||||||
|
$ref: '#/components/requestBodies/UserArray'
|
||||||
|
/user/login:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- user
|
||||||
|
summary: Logs user into the system
|
||||||
|
description: ''
|
||||||
|
operationId: loginUser
|
||||||
|
parameters:
|
||||||
|
- name: username
|
||||||
|
in: query
|
||||||
|
description: The user name for login
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$'
|
||||||
|
- name: password
|
||||||
|
in: query
|
||||||
|
description: The password for login in clear text
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: successful operation
|
||||||
|
headers:
|
||||||
|
Set-Cookie:
|
||||||
|
description: >-
|
||||||
|
Cookie authentication key for use with the `api_key`
|
||||||
|
apiKey authentication.
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
example: AUTH_KEY=abcde12345; Path=/; HttpOnly
|
||||||
|
X-Rate-Limit:
|
||||||
|
description: calls per hour allowed by the user
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
|
X-Expires-After:
|
||||||
|
description: date in UTC when token expires
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
content:
|
||||||
|
application/xml:
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
'400':
|
||||||
|
description: Invalid username/password supplied
|
||||||
|
/user/logout:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- user
|
||||||
|
summary: Logs out current logged in user session
|
||||||
|
description: ''
|
||||||
|
operationId: logoutUser
|
||||||
|
responses:
|
||||||
|
default:
|
||||||
|
description: successful operation
|
||||||
|
security:
|
||||||
|
- api_key: []
|
||||||
|
'/user/{username}':
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- user
|
||||||
|
summary: Get user by user name
|
||||||
|
description: ''
|
||||||
|
operationId: getUserByName
|
||||||
|
parameters:
|
||||||
|
- name: username
|
||||||
|
in: path
|
||||||
|
description: The name that needs to be fetched. Use user1 for testing.
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: successful operation
|
||||||
|
content:
|
||||||
|
application/xml:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/User'
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/User'
|
||||||
|
'400':
|
||||||
|
description: Invalid username supplied
|
||||||
|
'404':
|
||||||
|
description: User not found
|
||||||
|
put:
|
||||||
|
tags:
|
||||||
|
- user
|
||||||
|
summary: Updated user
|
||||||
|
description: This can only be done by the logged in user.
|
||||||
|
operationId: updateUser
|
||||||
|
parameters:
|
||||||
|
- name: username
|
||||||
|
in: path
|
||||||
|
description: name that need to be deleted
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
'400':
|
||||||
|
description: Invalid user supplied
|
||||||
|
'404':
|
||||||
|
description: User not found
|
||||||
|
security:
|
||||||
|
- api_key: []
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/User'
|
||||||
|
description: Updated user object
|
||||||
|
required: true
|
||||||
|
delete:
|
||||||
|
tags:
|
||||||
|
- user
|
||||||
|
summary: Delete user
|
||||||
|
description: This can only be done by the logged in user.
|
||||||
|
operationId: deleteUser
|
||||||
|
parameters:
|
||||||
|
- name: username
|
||||||
|
in: path
|
||||||
|
description: The name that needs to be deleted
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
responses:
|
||||||
|
'400':
|
||||||
|
description: Invalid username supplied
|
||||||
|
'404':
|
||||||
|
description: User not found
|
||||||
|
security:
|
||||||
|
- api_key: []
|
||||||
|
/fake/parameter_example_test:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- fake
|
||||||
|
summary: fake endpoint to test parameter example (object)
|
||||||
|
description: ''
|
||||||
|
operationId: fake_parameter_example_test
|
||||||
|
parameters:
|
||||||
|
- name: data
|
||||||
|
in: query
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/Pet"
|
||||||
|
responses:
|
||||||
|
default:
|
||||||
|
description: successful operation
|
||||||
|
externalDocs:
|
||||||
|
description: Find out more about Swagger
|
||||||
|
url: 'http://swagger.io'
|
||||||
|
components:
|
||||||
|
requestBodies:
|
||||||
|
UserArray:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/User'
|
||||||
|
description: List of user object
|
||||||
|
required: true
|
||||||
|
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
|
||||||
|
required: true
|
||||||
|
securitySchemes:
|
||||||
|
petstore_auth:
|
||||||
|
type: oauth2
|
||||||
|
flows:
|
||||||
|
implicit:
|
||||||
|
authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog'
|
||||||
|
scopes:
|
||||||
|
'write:pets': modify pets in your account
|
||||||
|
'read:pets': read your pets
|
||||||
|
api_key:
|
||||||
|
type: apiKey
|
||||||
|
name: api_key
|
||||||
|
in: header
|
||||||
|
schemas:
|
||||||
|
Order:
|
||||||
|
title: Pet Order
|
||||||
|
description: An order for a pets from the pet store
|
||||||
|
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
|
||||||
|
Category:
|
||||||
|
title: Pet category
|
||||||
|
description: A category for a pet
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$'
|
||||||
|
xml:
|
||||||
|
name: Category
|
||||||
|
User:
|
||||||
|
title: a User
|
||||||
|
description: A User who is purchasing from the pet store
|
||||||
|
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
|
||||||
|
Tag:
|
||||||
|
title: Pet Tag
|
||||||
|
description: A tag for a pet
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
xml:
|
||||||
|
name: Tag
|
||||||
|
Pet:
|
||||||
|
title: a Pet
|
||||||
|
description: A pet for sale in the pet store
|
||||||
|
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
|
||||||
|
deprecated: true
|
||||||
|
enum:
|
||||||
|
- available
|
||||||
|
- pending
|
||||||
|
- sold
|
||||||
|
xml:
|
||||||
|
name: Pet
|
||||||
|
ApiResponse:
|
||||||
|
title: An uploaded response
|
||||||
|
description: Describes the result of uploading an image resource
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
code:
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
message:
|
||||||
|
type: string
|
@ -5,6 +5,7 @@ build.sh
|
|||||||
src/Org.OpenAPITools/.gitignore
|
src/Org.OpenAPITools/.gitignore
|
||||||
src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs
|
src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs
|
||||||
src/Org.OpenAPITools/Authentication/ApiAuthentication.cs
|
src/Org.OpenAPITools/Authentication/ApiAuthentication.cs
|
||||||
|
src/Org.OpenAPITools/Controllers/FakeApi.cs
|
||||||
src/Org.OpenAPITools/Controllers/PetApi.cs
|
src/Org.OpenAPITools/Controllers/PetApi.cs
|
||||||
src/Org.OpenAPITools/Controllers/StoreApi.cs
|
src/Org.OpenAPITools/Controllers/StoreApi.cs
|
||||||
src/Org.OpenAPITools/Controllers/UserApi.cs
|
src/Org.OpenAPITools/Controllers/UserApi.cs
|
||||||
|
@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* OpenAPI Petstore
|
||||||
|
*
|
||||||
|
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
* Generated by: https://openapi-generator.tech
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Swashbuckle.AspNetCore.Annotations;
|
||||||
|
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Org.OpenAPITools.Attributes;
|
||||||
|
using Org.OpenAPITools.Models;
|
||||||
|
|
||||||
|
namespace Org.OpenAPITools.Controllers
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[ApiController]
|
||||||
|
public class FakeApiController : ControllerBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// fake endpoint to test parameter example (object)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="data"></param>
|
||||||
|
/// <response code="0">successful operation</response>
|
||||||
|
[HttpGet]
|
||||||
|
[Route("/v2/fake/parameter_example_test")]
|
||||||
|
[ValidateModelState]
|
||||||
|
[SwaggerOperation("FakeParameterExampleTest")]
|
||||||
|
public virtual IActionResult FakeParameterExampleTest([FromQuery (Name = "data")][Required()]Pet data)
|
||||||
|
{
|
||||||
|
|
||||||
|
//TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
|
// return StatusCode(0);
|
||||||
|
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -31,20 +31,31 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add a new pet to the store
|
/// Add a new pet to the store
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="body">Pet object that needs to be added to the store</param>
|
/// <param name="pet">Pet object that needs to be added to the store</param>
|
||||||
|
/// <response code="200">successful operation</response>
|
||||||
/// <response code="405">Invalid input</response>
|
/// <response code="405">Invalid input</response>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("/v2/pet")]
|
[Route("/v2/pet")]
|
||||||
[Consumes("application/json", "application/xml")]
|
[Consumes("application/json", "application/xml")]
|
||||||
[ValidateModelState]
|
[ValidateModelState]
|
||||||
[SwaggerOperation("AddPet")]
|
[SwaggerOperation("AddPet")]
|
||||||
public virtual IActionResult AddPet([FromBody]Pet body)
|
[SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")]
|
||||||
|
public virtual IActionResult AddPet([FromBody]Pet pet)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
|
// return StatusCode(200, default(Pet));
|
||||||
//TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
//TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
// return StatusCode(405);
|
// return StatusCode(405);
|
||||||
|
string exampleJson = null;
|
||||||
throw new NotImplementedException();
|
exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}";
|
||||||
|
exampleJson = "<Pet>\n <id>123456789</id>\n <name>doggie</name>\n <photoUrls>\n <photoUrls>aeiou</photoUrls>\n </photoUrls>\n <tags>\n </tags>\n <status>aeiou</status>\n</Pet>";
|
||||||
|
|
||||||
|
var example = exampleJson != null
|
||||||
|
? JsonConvert.DeserializeObject<Pet>(exampleJson)
|
||||||
|
: default(Pet);
|
||||||
|
//TODO: Change the data returned
|
||||||
|
return new ObjectResult(example);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -70,7 +81,7 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
/// Finds Pets by status
|
/// Finds Pets by status
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>Multiple status values can be provided with comma separated strings</remarks>
|
/// <remarks>Multiple status values can be provided with comma separated strings</remarks>
|
||||||
/// <param name="status">Status values that need to be considered for filter</param>
|
/// <param name="status">Status values that need to be considered for filter (deprecated)</param>
|
||||||
/// <response code="200">successful operation</response>
|
/// <response code="200">successful operation</response>
|
||||||
/// <response code="400">Invalid status value</response>
|
/// <response code="400">Invalid status value</response>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
@ -164,7 +175,8 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update an existing pet
|
/// Update an existing pet
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="body">Pet object that needs to be added to the store</param>
|
/// <param name="pet">Pet object that needs to be added to the store</param>
|
||||||
|
/// <response code="200">successful operation</response>
|
||||||
/// <response code="400">Invalid ID supplied</response>
|
/// <response code="400">Invalid ID supplied</response>
|
||||||
/// <response code="404">Pet not found</response>
|
/// <response code="404">Pet not found</response>
|
||||||
/// <response code="405">Validation exception</response>
|
/// <response code="405">Validation exception</response>
|
||||||
@ -173,17 +185,27 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
[Consumes("application/json", "application/xml")]
|
[Consumes("application/json", "application/xml")]
|
||||||
[ValidateModelState]
|
[ValidateModelState]
|
||||||
[SwaggerOperation("UpdatePet")]
|
[SwaggerOperation("UpdatePet")]
|
||||||
public virtual IActionResult UpdatePet([FromBody]Pet body)
|
[SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")]
|
||||||
|
public virtual IActionResult UpdatePet([FromBody]Pet pet)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
|
// return StatusCode(200, default(Pet));
|
||||||
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
// return StatusCode(400);
|
// return StatusCode(400);
|
||||||
//TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
//TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
// return StatusCode(404);
|
// return StatusCode(404);
|
||||||
//TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
//TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
// return StatusCode(405);
|
// return StatusCode(405);
|
||||||
|
string exampleJson = null;
|
||||||
throw new NotImplementedException();
|
exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}";
|
||||||
|
exampleJson = "<Pet>\n <id>123456789</id>\n <name>doggie</name>\n <photoUrls>\n <photoUrls>aeiou</photoUrls>\n </photoUrls>\n <tags>\n </tags>\n <status>aeiou</status>\n</Pet>";
|
||||||
|
|
||||||
|
var example = exampleJson != null
|
||||||
|
? JsonConvert.DeserializeObject<Pet>(exampleJson)
|
||||||
|
: default(Pet);
|
||||||
|
//TODO: Change the data returned
|
||||||
|
return new ObjectResult(example);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -111,15 +111,16 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Place an order for a pet
|
/// Place an order for a pet
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="body">order placed for purchasing the pet</param>
|
/// <param name="order">order placed for purchasing the pet</param>
|
||||||
/// <response code="200">successful operation</response>
|
/// <response code="200">successful operation</response>
|
||||||
/// <response code="400">Invalid Order</response>
|
/// <response code="400">Invalid Order</response>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("/v2/store/order")]
|
[Route("/v2/store/order")]
|
||||||
|
[Consumes("application/json")]
|
||||||
[ValidateModelState]
|
[ValidateModelState]
|
||||||
[SwaggerOperation("PlaceOrder")]
|
[SwaggerOperation("PlaceOrder")]
|
||||||
[SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")]
|
[SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")]
|
||||||
public virtual IActionResult PlaceOrder([FromBody]Order body)
|
public virtual IActionResult PlaceOrder([FromBody]Order order)
|
||||||
{
|
{
|
||||||
|
|
||||||
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
|
@ -32,13 +32,15 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
/// Create user
|
/// Create user
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>This can only be done by the logged in user.</remarks>
|
/// <remarks>This can only be done by the logged in user.</remarks>
|
||||||
/// <param name="body">Created user object</param>
|
/// <param name="user">Created user object</param>
|
||||||
/// <response code="0">successful operation</response>
|
/// <response code="0">successful operation</response>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("/v2/user")]
|
[Route("/v2/user")]
|
||||||
|
[Authorize(Policy = "api_key")]
|
||||||
|
[Consumes("application/json")]
|
||||||
[ValidateModelState]
|
[ValidateModelState]
|
||||||
[SwaggerOperation("CreateUser")]
|
[SwaggerOperation("CreateUser")]
|
||||||
public virtual IActionResult CreateUser([FromBody]User body)
|
public virtual IActionResult CreateUser([FromBody]User user)
|
||||||
{
|
{
|
||||||
|
|
||||||
//TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
//TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
@ -50,13 +52,15 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates list of users with given input array
|
/// Creates list of users with given input array
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="body">List of user object</param>
|
/// <param name="user">List of user object</param>
|
||||||
/// <response code="0">successful operation</response>
|
/// <response code="0">successful operation</response>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("/v2/user/createWithArray")]
|
[Route("/v2/user/createWithArray")]
|
||||||
|
[Authorize(Policy = "api_key")]
|
||||||
|
[Consumes("application/json")]
|
||||||
[ValidateModelState]
|
[ValidateModelState]
|
||||||
[SwaggerOperation("CreateUsersWithArrayInput")]
|
[SwaggerOperation("CreateUsersWithArrayInput")]
|
||||||
public virtual IActionResult CreateUsersWithArrayInput([FromBody]List<User> body)
|
public virtual IActionResult CreateUsersWithArrayInput([FromBody]List<User> user)
|
||||||
{
|
{
|
||||||
|
|
||||||
//TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
//TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
@ -68,13 +72,15 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates list of users with given input array
|
/// Creates list of users with given input array
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="body">List of user object</param>
|
/// <param name="user">List of user object</param>
|
||||||
/// <response code="0">successful operation</response>
|
/// <response code="0">successful operation</response>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("/v2/user/createWithList")]
|
[Route("/v2/user/createWithList")]
|
||||||
|
[Authorize(Policy = "api_key")]
|
||||||
|
[Consumes("application/json")]
|
||||||
[ValidateModelState]
|
[ValidateModelState]
|
||||||
[SwaggerOperation("CreateUsersWithListInput")]
|
[SwaggerOperation("CreateUsersWithListInput")]
|
||||||
public virtual IActionResult CreateUsersWithListInput([FromBody]List<User> body)
|
public virtual IActionResult CreateUsersWithListInput([FromBody]List<User> user)
|
||||||
{
|
{
|
||||||
|
|
||||||
//TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
//TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
@ -92,6 +98,7 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
/// <response code="404">User not found</response>
|
/// <response code="404">User not found</response>
|
||||||
[HttpDelete]
|
[HttpDelete]
|
||||||
[Route("/v2/user/{username}")]
|
[Route("/v2/user/{username}")]
|
||||||
|
[Authorize(Policy = "api_key")]
|
||||||
[ValidateModelState]
|
[ValidateModelState]
|
||||||
[SwaggerOperation("DeleteUser")]
|
[SwaggerOperation("DeleteUser")]
|
||||||
public virtual IActionResult DeleteUser([FromRoute (Name = "username")][Required]string username)
|
public virtual IActionResult DeleteUser([FromRoute (Name = "username")][Required]string username)
|
||||||
@ -149,7 +156,7 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
[ValidateModelState]
|
[ValidateModelState]
|
||||||
[SwaggerOperation("LoginUser")]
|
[SwaggerOperation("LoginUser")]
|
||||||
[SwaggerResponse(statusCode: 200, type: typeof(string), description: "successful operation")]
|
[SwaggerResponse(statusCode: 200, type: typeof(string), description: "successful operation")]
|
||||||
public virtual IActionResult LoginUser([FromQuery (Name = "username")][Required()]string username, [FromQuery (Name = "password")][Required()]string password)
|
public virtual IActionResult LoginUser([FromQuery (Name = "username")][Required()][RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")]string username, [FromQuery (Name = "password")][Required()]string password)
|
||||||
{
|
{
|
||||||
|
|
||||||
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
@ -171,6 +178,7 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
/// <response code="0">successful operation</response>
|
/// <response code="0">successful operation</response>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("/v2/user/logout")]
|
[Route("/v2/user/logout")]
|
||||||
|
[Authorize(Policy = "api_key")]
|
||||||
[ValidateModelState]
|
[ValidateModelState]
|
||||||
[SwaggerOperation("LogoutUser")]
|
[SwaggerOperation("LogoutUser")]
|
||||||
public virtual IActionResult LogoutUser()
|
public virtual IActionResult LogoutUser()
|
||||||
@ -187,14 +195,16 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>This can only be done by the logged in user.</remarks>
|
/// <remarks>This can only be done by the logged in user.</remarks>
|
||||||
/// <param name="username">name that need to be deleted</param>
|
/// <param name="username">name that need to be deleted</param>
|
||||||
/// <param name="body">Updated user object</param>
|
/// <param name="user">Updated user object</param>
|
||||||
/// <response code="400">Invalid user supplied</response>
|
/// <response code="400">Invalid user supplied</response>
|
||||||
/// <response code="404">User not found</response>
|
/// <response code="404">User not found</response>
|
||||||
[HttpPut]
|
[HttpPut]
|
||||||
[Route("/v2/user/{username}")]
|
[Route("/v2/user/{username}")]
|
||||||
|
[Authorize(Policy = "api_key")]
|
||||||
|
[Consumes("application/json")]
|
||||||
[ValidateModelState]
|
[ValidateModelState]
|
||||||
[SwaggerOperation("UpdateUser")]
|
[SwaggerOperation("UpdateUser")]
|
||||||
public virtual IActionResult UpdateUser([FromRoute (Name = "username")][Required]string username, [FromBody]User body)
|
public virtual IActionResult UpdateUser([FromRoute (Name = "username")][Required]string username, [FromBody]User user)
|
||||||
{
|
{
|
||||||
|
|
||||||
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
|
@ -35,6 +35,7 @@ namespace Org.OpenAPITools.Models
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or Sets Name
|
/// Gets or Sets Name
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")]
|
||||||
[DataMember(Name="name", EmitDefaultValue=false)]
|
[DataMember(Name="name", EmitDefaultValue=false)]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"openapi" : "3.0.1",
|
"openapi" : "3.0.0",
|
||||||
"info" : {
|
"info" : {
|
||||||
"description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.",
|
"description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.",
|
||||||
"license" : {
|
"license" : {
|
||||||
@ -9,6 +9,10 @@
|
|||||||
"title" : "OpenAPI Petstore",
|
"title" : "OpenAPI Petstore",
|
||||||
"version" : "1.0.0"
|
"version" : "1.0.0"
|
||||||
},
|
},
|
||||||
|
"externalDocs" : {
|
||||||
|
"description" : "Find out more about Swagger",
|
||||||
|
"url" : "http://swagger.io"
|
||||||
|
},
|
||||||
"servers" : [ {
|
"servers" : [ {
|
||||||
"url" : "http://petstore.swagger.io/v2"
|
"url" : "http://petstore.swagger.io/v2"
|
||||||
} ],
|
} ],
|
||||||
@ -25,26 +29,28 @@
|
|||||||
"paths" : {
|
"paths" : {
|
||||||
"/pet" : {
|
"/pet" : {
|
||||||
"post" : {
|
"post" : {
|
||||||
|
"description" : "",
|
||||||
"operationId" : "addPet",
|
"operationId" : "addPet",
|
||||||
"requestBody" : {
|
"requestBody" : {
|
||||||
"content" : {
|
"$ref" : "#/components/requestBodies/Pet"
|
||||||
"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",
|
|
||||||
"required" : true
|
|
||||||
},
|
},
|
||||||
"responses" : {
|
"responses" : {
|
||||||
|
"200" : {
|
||||||
|
"content" : {
|
||||||
|
"application/xml" : {
|
||||||
|
"schema" : {
|
||||||
|
"$ref" : "#/components/schemas/Pet"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"application/json" : {
|
||||||
|
"schema" : {
|
||||||
|
"$ref" : "#/components/schemas/Pet"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description" : "successful operation"
|
||||||
|
},
|
||||||
"405" : {
|
"405" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid input"
|
"description" : "Invalid input"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -52,38 +58,37 @@
|
|||||||
"petstore_auth" : [ "write:pets", "read:pets" ]
|
"petstore_auth" : [ "write:pets", "read:pets" ]
|
||||||
} ],
|
} ],
|
||||||
"summary" : "Add a new pet to the store",
|
"summary" : "Add a new pet to the store",
|
||||||
"tags" : [ "pet" ],
|
"tags" : [ "pet" ]
|
||||||
"x-codegen-request-body-name" : "body"
|
|
||||||
},
|
},
|
||||||
"put" : {
|
"put" : {
|
||||||
|
"description" : "",
|
||||||
"operationId" : "updatePet",
|
"operationId" : "updatePet",
|
||||||
"requestBody" : {
|
"requestBody" : {
|
||||||
"content" : {
|
"$ref" : "#/components/requestBodies/Pet"
|
||||||
"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",
|
|
||||||
"required" : true
|
|
||||||
},
|
},
|
||||||
"responses" : {
|
"responses" : {
|
||||||
|
"200" : {
|
||||||
|
"content" : {
|
||||||
|
"application/xml" : {
|
||||||
|
"schema" : {
|
||||||
|
"$ref" : "#/components/schemas/Pet"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"application/json" : {
|
||||||
|
"schema" : {
|
||||||
|
"$ref" : "#/components/schemas/Pet"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description" : "successful operation"
|
||||||
|
},
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid ID supplied"
|
"description" : "Invalid ID supplied"
|
||||||
},
|
},
|
||||||
"404" : {
|
"404" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Pet not found"
|
"description" : "Pet not found"
|
||||||
},
|
},
|
||||||
"405" : {
|
"405" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Validation exception"
|
"description" : "Validation exception"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -91,8 +96,7 @@
|
|||||||
"petstore_auth" : [ "write:pets", "read:pets" ]
|
"petstore_auth" : [ "write:pets", "read:pets" ]
|
||||||
} ],
|
} ],
|
||||||
"summary" : "Update an existing pet",
|
"summary" : "Update an existing pet",
|
||||||
"tags" : [ "pet" ],
|
"tags" : [ "pet" ]
|
||||||
"x-codegen-request-body-name" : "body"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/pet/findByStatus" : {
|
"/pet/findByStatus" : {
|
||||||
@ -100,6 +104,7 @@
|
|||||||
"description" : "Multiple status values can be provided with comma separated strings",
|
"description" : "Multiple status values can be provided with comma separated strings",
|
||||||
"operationId" : "findPetsByStatus",
|
"operationId" : "findPetsByStatus",
|
||||||
"parameters" : [ {
|
"parameters" : [ {
|
||||||
|
"deprecated" : true,
|
||||||
"description" : "Status values that need to be considered for filter",
|
"description" : "Status values that need to be considered for filter",
|
||||||
"explode" : false,
|
"explode" : false,
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
@ -138,12 +143,11 @@
|
|||||||
"description" : "successful operation"
|
"description" : "successful operation"
|
||||||
},
|
},
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid status value"
|
"description" : "Invalid status value"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"security" : [ {
|
"security" : [ {
|
||||||
"petstore_auth" : [ "write:pets", "read:pets" ]
|
"petstore_auth" : [ "read:pets" ]
|
||||||
} ],
|
} ],
|
||||||
"summary" : "Finds Pets by status",
|
"summary" : "Finds Pets by status",
|
||||||
"tags" : [ "pet" ]
|
"tags" : [ "pet" ]
|
||||||
@ -191,12 +195,11 @@
|
|||||||
"description" : "successful operation"
|
"description" : "successful operation"
|
||||||
},
|
},
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid tag value"
|
"description" : "Invalid tag value"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"security" : [ {
|
"security" : [ {
|
||||||
"petstore_auth" : [ "write:pets", "read:pets" ]
|
"petstore_auth" : [ "read:pets" ]
|
||||||
} ],
|
} ],
|
||||||
"summary" : "Finds Pets by tags",
|
"summary" : "Finds Pets by tags",
|
||||||
"tags" : [ "pet" ]
|
"tags" : [ "pet" ]
|
||||||
@ -204,26 +207,31 @@
|
|||||||
},
|
},
|
||||||
"/pet/{petId}" : {
|
"/pet/{petId}" : {
|
||||||
"delete" : {
|
"delete" : {
|
||||||
|
"description" : "",
|
||||||
"operationId" : "deletePet",
|
"operationId" : "deletePet",
|
||||||
"parameters" : [ {
|
"parameters" : [ {
|
||||||
|
"explode" : false,
|
||||||
"in" : "header",
|
"in" : "header",
|
||||||
"name" : "api_key",
|
"name" : "api_key",
|
||||||
|
"required" : false,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
}, {
|
}, {
|
||||||
"description" : "Pet id to delete",
|
"description" : "Pet id to delete",
|
||||||
|
"explode" : false,
|
||||||
"in" : "path",
|
"in" : "path",
|
||||||
"name" : "petId",
|
"name" : "petId",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int64",
|
"format" : "int64",
|
||||||
"type" : "integer"
|
"type" : "integer"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
} ],
|
} ],
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid pet value"
|
"description" : "Invalid pet value"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -238,13 +246,15 @@
|
|||||||
"operationId" : "getPetById",
|
"operationId" : "getPetById",
|
||||||
"parameters" : [ {
|
"parameters" : [ {
|
||||||
"description" : "ID of pet to return",
|
"description" : "ID of pet to return",
|
||||||
|
"explode" : false,
|
||||||
"in" : "path",
|
"in" : "path",
|
||||||
"name" : "petId",
|
"name" : "petId",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int64",
|
"format" : "int64",
|
||||||
"type" : "integer"
|
"type" : "integer"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
} ],
|
} ],
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"200" : {
|
"200" : {
|
||||||
@ -263,11 +273,9 @@
|
|||||||
"description" : "successful operation"
|
"description" : "successful operation"
|
||||||
},
|
},
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid ID supplied"
|
"description" : "Invalid ID supplied"
|
||||||
},
|
},
|
||||||
"404" : {
|
"404" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Pet not found"
|
"description" : "Pet not found"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -278,16 +286,19 @@
|
|||||||
"tags" : [ "pet" ]
|
"tags" : [ "pet" ]
|
||||||
},
|
},
|
||||||
"post" : {
|
"post" : {
|
||||||
|
"description" : "",
|
||||||
"operationId" : "updatePetWithForm",
|
"operationId" : "updatePetWithForm",
|
||||||
"parameters" : [ {
|
"parameters" : [ {
|
||||||
"description" : "ID of pet that needs to be updated",
|
"description" : "ID of pet that needs to be updated",
|
||||||
|
"explode" : false,
|
||||||
"in" : "path",
|
"in" : "path",
|
||||||
"name" : "petId",
|
"name" : "petId",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int64",
|
"format" : "int64",
|
||||||
"type" : "integer"
|
"type" : "integer"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
} ],
|
} ],
|
||||||
"requestBody" : {
|
"requestBody" : {
|
||||||
"content" : {
|
"content" : {
|
||||||
@ -300,7 +311,6 @@
|
|||||||
},
|
},
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"405" : {
|
"405" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid input"
|
"description" : "Invalid input"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -313,16 +323,19 @@
|
|||||||
},
|
},
|
||||||
"/pet/{petId}/uploadImage" : {
|
"/pet/{petId}/uploadImage" : {
|
||||||
"post" : {
|
"post" : {
|
||||||
|
"description" : "",
|
||||||
"operationId" : "uploadFile",
|
"operationId" : "uploadFile",
|
||||||
"parameters" : [ {
|
"parameters" : [ {
|
||||||
"description" : "ID of pet to update",
|
"description" : "ID of pet to update",
|
||||||
|
"explode" : false,
|
||||||
"in" : "path",
|
"in" : "path",
|
||||||
"name" : "petId",
|
"name" : "petId",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int64",
|
"format" : "int64",
|
||||||
"type" : "integer"
|
"type" : "integer"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
} ],
|
} ],
|
||||||
"requestBody" : {
|
"requestBody" : {
|
||||||
"content" : {
|
"content" : {
|
||||||
@ -381,10 +394,11 @@
|
|||||||
},
|
},
|
||||||
"/store/order" : {
|
"/store/order" : {
|
||||||
"post" : {
|
"post" : {
|
||||||
|
"description" : "",
|
||||||
"operationId" : "placeOrder",
|
"operationId" : "placeOrder",
|
||||||
"requestBody" : {
|
"requestBody" : {
|
||||||
"content" : {
|
"content" : {
|
||||||
"*/*" : {
|
"application/json" : {
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"$ref" : "#/components/schemas/Order"
|
"$ref" : "#/components/schemas/Order"
|
||||||
}
|
}
|
||||||
@ -410,13 +424,11 @@
|
|||||||
"description" : "successful operation"
|
"description" : "successful operation"
|
||||||
},
|
},
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid Order"
|
"description" : "Invalid Order"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"summary" : "Place an order for a pet",
|
"summary" : "Place an order for a pet",
|
||||||
"tags" : [ "store" ],
|
"tags" : [ "store" ]
|
||||||
"x-codegen-request-body-name" : "body"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/store/order/{orderId}" : {
|
"/store/order/{orderId}" : {
|
||||||
@ -425,20 +437,20 @@
|
|||||||
"operationId" : "deleteOrder",
|
"operationId" : "deleteOrder",
|
||||||
"parameters" : [ {
|
"parameters" : [ {
|
||||||
"description" : "ID of the order that needs to be deleted",
|
"description" : "ID of the order that needs to be deleted",
|
||||||
|
"explode" : false,
|
||||||
"in" : "path",
|
"in" : "path",
|
||||||
"name" : "orderId",
|
"name" : "orderId",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
} ],
|
} ],
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid ID supplied"
|
"description" : "Invalid ID supplied"
|
||||||
},
|
},
|
||||||
"404" : {
|
"404" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Order not found"
|
"description" : "Order not found"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -450,6 +462,7 @@
|
|||||||
"operationId" : "getOrderById",
|
"operationId" : "getOrderById",
|
||||||
"parameters" : [ {
|
"parameters" : [ {
|
||||||
"description" : "ID of pet that needs to be fetched",
|
"description" : "ID of pet that needs to be fetched",
|
||||||
|
"explode" : false,
|
||||||
"in" : "path",
|
"in" : "path",
|
||||||
"name" : "orderId",
|
"name" : "orderId",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
@ -458,7 +471,8 @@
|
|||||||
"maximum" : 5,
|
"maximum" : 5,
|
||||||
"minimum" : 1,
|
"minimum" : 1,
|
||||||
"type" : "integer"
|
"type" : "integer"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
} ],
|
} ],
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"200" : {
|
"200" : {
|
||||||
@ -477,11 +491,9 @@
|
|||||||
"description" : "successful operation"
|
"description" : "successful operation"
|
||||||
},
|
},
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid ID supplied"
|
"description" : "Invalid ID supplied"
|
||||||
},
|
},
|
||||||
"404" : {
|
"404" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Order not found"
|
"description" : "Order not found"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -495,7 +507,7 @@
|
|||||||
"operationId" : "createUser",
|
"operationId" : "createUser",
|
||||||
"requestBody" : {
|
"requestBody" : {
|
||||||
"content" : {
|
"content" : {
|
||||||
"*/*" : {
|
"application/json" : {
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"$ref" : "#/components/schemas/User"
|
"$ref" : "#/components/schemas/User"
|
||||||
}
|
}
|
||||||
@ -506,90 +518,79 @@
|
|||||||
},
|
},
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"default" : {
|
"default" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "successful operation"
|
"description" : "successful operation"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"security" : [ {
|
||||||
|
"api_key" : [ ]
|
||||||
|
} ],
|
||||||
"summary" : "Create user",
|
"summary" : "Create user",
|
||||||
"tags" : [ "user" ],
|
"tags" : [ "user" ]
|
||||||
"x-codegen-request-body-name" : "body"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/user/createWithArray" : {
|
"/user/createWithArray" : {
|
||||||
"post" : {
|
"post" : {
|
||||||
|
"description" : "",
|
||||||
"operationId" : "createUsersWithArrayInput",
|
"operationId" : "createUsersWithArrayInput",
|
||||||
"requestBody" : {
|
"requestBody" : {
|
||||||
"content" : {
|
"$ref" : "#/components/requestBodies/UserArray"
|
||||||
"*/*" : {
|
|
||||||
"schema" : {
|
|
||||||
"items" : {
|
|
||||||
"$ref" : "#/components/schemas/User"
|
|
||||||
},
|
|
||||||
"type" : "array"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"description" : "List of user object",
|
|
||||||
"required" : true
|
|
||||||
},
|
},
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"default" : {
|
"default" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "successful operation"
|
"description" : "successful operation"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"security" : [ {
|
||||||
|
"api_key" : [ ]
|
||||||
|
} ],
|
||||||
"summary" : "Creates list of users with given input array",
|
"summary" : "Creates list of users with given input array",
|
||||||
"tags" : [ "user" ],
|
"tags" : [ "user" ]
|
||||||
"x-codegen-request-body-name" : "body"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/user/createWithList" : {
|
"/user/createWithList" : {
|
||||||
"post" : {
|
"post" : {
|
||||||
|
"description" : "",
|
||||||
"operationId" : "createUsersWithListInput",
|
"operationId" : "createUsersWithListInput",
|
||||||
"requestBody" : {
|
"requestBody" : {
|
||||||
"content" : {
|
"$ref" : "#/components/requestBodies/UserArray"
|
||||||
"*/*" : {
|
|
||||||
"schema" : {
|
|
||||||
"items" : {
|
|
||||||
"$ref" : "#/components/schemas/User"
|
|
||||||
},
|
|
||||||
"type" : "array"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"description" : "List of user object",
|
|
||||||
"required" : true
|
|
||||||
},
|
},
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"default" : {
|
"default" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "successful operation"
|
"description" : "successful operation"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"security" : [ {
|
||||||
|
"api_key" : [ ]
|
||||||
|
} ],
|
||||||
"summary" : "Creates list of users with given input array",
|
"summary" : "Creates list of users with given input array",
|
||||||
"tags" : [ "user" ],
|
"tags" : [ "user" ]
|
||||||
"x-codegen-request-body-name" : "body"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/user/login" : {
|
"/user/login" : {
|
||||||
"get" : {
|
"get" : {
|
||||||
|
"description" : "",
|
||||||
"operationId" : "loginUser",
|
"operationId" : "loginUser",
|
||||||
"parameters" : [ {
|
"parameters" : [ {
|
||||||
"description" : "The user name for login",
|
"description" : "The user name for login",
|
||||||
|
"explode" : true,
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
"name" : "username",
|
"name" : "username",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
|
"pattern" : "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$",
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
},
|
||||||
|
"style" : "form"
|
||||||
}, {
|
}, {
|
||||||
"description" : "The password for login in clear text",
|
"description" : "The password for login in clear text",
|
||||||
|
"explode" : true,
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
"name" : "password",
|
"name" : "password",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
},
|
||||||
|
"style" : "form"
|
||||||
} ],
|
} ],
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"200" : {
|
"200" : {
|
||||||
@ -607,24 +608,36 @@
|
|||||||
},
|
},
|
||||||
"description" : "successful operation",
|
"description" : "successful operation",
|
||||||
"headers" : {
|
"headers" : {
|
||||||
|
"Set-Cookie" : {
|
||||||
|
"description" : "Cookie authentication key for use with the `api_key` apiKey authentication.",
|
||||||
|
"explode" : false,
|
||||||
|
"schema" : {
|
||||||
|
"example" : "AUTH_KEY=abcde12345; Path=/; HttpOnly",
|
||||||
|
"type" : "string"
|
||||||
|
},
|
||||||
|
"style" : "simple"
|
||||||
|
},
|
||||||
"X-Rate-Limit" : {
|
"X-Rate-Limit" : {
|
||||||
"description" : "calls per hour allowed by the user",
|
"description" : "calls per hour allowed by the user",
|
||||||
|
"explode" : false,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int32",
|
"format" : "int32",
|
||||||
"type" : "integer"
|
"type" : "integer"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
},
|
},
|
||||||
"X-Expires-After" : {
|
"X-Expires-After" : {
|
||||||
"description" : "date in UTC when token expires",
|
"description" : "date in UTC when token expires",
|
||||||
|
"explode" : false,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "date-time",
|
"format" : "date-time",
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid username/password supplied"
|
"description" : "Invalid username/password supplied"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -634,13 +647,16 @@
|
|||||||
},
|
},
|
||||||
"/user/logout" : {
|
"/user/logout" : {
|
||||||
"get" : {
|
"get" : {
|
||||||
|
"description" : "",
|
||||||
"operationId" : "logoutUser",
|
"operationId" : "logoutUser",
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"default" : {
|
"default" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "successful operation"
|
"description" : "successful operation"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"security" : [ {
|
||||||
|
"api_key" : [ ]
|
||||||
|
} ],
|
||||||
"summary" : "Logs out current logged in user session",
|
"summary" : "Logs out current logged in user session",
|
||||||
"tags" : [ "user" ]
|
"tags" : [ "user" ]
|
||||||
}
|
}
|
||||||
@ -651,36 +667,42 @@
|
|||||||
"operationId" : "deleteUser",
|
"operationId" : "deleteUser",
|
||||||
"parameters" : [ {
|
"parameters" : [ {
|
||||||
"description" : "The name that needs to be deleted",
|
"description" : "The name that needs to be deleted",
|
||||||
|
"explode" : false,
|
||||||
"in" : "path",
|
"in" : "path",
|
||||||
"name" : "username",
|
"name" : "username",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
} ],
|
} ],
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid username supplied"
|
"description" : "Invalid username supplied"
|
||||||
},
|
},
|
||||||
"404" : {
|
"404" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "User not found"
|
"description" : "User not found"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"security" : [ {
|
||||||
|
"api_key" : [ ]
|
||||||
|
} ],
|
||||||
"summary" : "Delete user",
|
"summary" : "Delete user",
|
||||||
"tags" : [ "user" ]
|
"tags" : [ "user" ]
|
||||||
},
|
},
|
||||||
"get" : {
|
"get" : {
|
||||||
|
"description" : "",
|
||||||
"operationId" : "getUserByName",
|
"operationId" : "getUserByName",
|
||||||
"parameters" : [ {
|
"parameters" : [ {
|
||||||
"description" : "The name that needs to be fetched. Use user1 for testing.",
|
"description" : "The name that needs to be fetched. Use user1 for testing.",
|
||||||
|
"explode" : false,
|
||||||
"in" : "path",
|
"in" : "path",
|
||||||
"name" : "username",
|
"name" : "username",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
} ],
|
} ],
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"200" : {
|
"200" : {
|
||||||
@ -699,11 +721,9 @@
|
|||||||
"description" : "successful operation"
|
"description" : "successful operation"
|
||||||
},
|
},
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid username supplied"
|
"description" : "Invalid username supplied"
|
||||||
},
|
},
|
||||||
"404" : {
|
"404" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "User not found"
|
"description" : "User not found"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -715,16 +735,18 @@
|
|||||||
"operationId" : "updateUser",
|
"operationId" : "updateUser",
|
||||||
"parameters" : [ {
|
"parameters" : [ {
|
||||||
"description" : "name that need to be deleted",
|
"description" : "name that need to be deleted",
|
||||||
|
"explode" : false,
|
||||||
"in" : "path",
|
"in" : "path",
|
||||||
"name" : "username",
|
"name" : "username",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
} ],
|
} ],
|
||||||
"requestBody" : {
|
"requestBody" : {
|
||||||
"content" : {
|
"content" : {
|
||||||
"*/*" : {
|
"application/json" : {
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"$ref" : "#/components/schemas/User"
|
"$ref" : "#/components/schemas/User"
|
||||||
}
|
}
|
||||||
@ -735,21 +757,76 @@
|
|||||||
},
|
},
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid user supplied"
|
"description" : "Invalid user supplied"
|
||||||
},
|
},
|
||||||
"404" : {
|
"404" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "User not found"
|
"description" : "User not found"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"security" : [ {
|
||||||
|
"api_key" : [ ]
|
||||||
|
} ],
|
||||||
"summary" : "Updated user",
|
"summary" : "Updated user",
|
||||||
"tags" : [ "user" ],
|
"tags" : [ "user" ]
|
||||||
"x-codegen-request-body-name" : "body"
|
}
|
||||||
|
},
|
||||||
|
"/fake/parameter_example_test" : {
|
||||||
|
"get" : {
|
||||||
|
"description" : "",
|
||||||
|
"operationId" : "fake_parameter_example_test",
|
||||||
|
"parameters" : [ {
|
||||||
|
"explode" : true,
|
||||||
|
"in" : "query",
|
||||||
|
"name" : "data",
|
||||||
|
"required" : true,
|
||||||
|
"schema" : {
|
||||||
|
"$ref" : "#/components/schemas/Pet"
|
||||||
|
},
|
||||||
|
"style" : "form"
|
||||||
|
} ],
|
||||||
|
"responses" : {
|
||||||
|
"default" : {
|
||||||
|
"description" : "successful operation"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"summary" : "fake endpoint to test parameter example (object)",
|
||||||
|
"tags" : [ "fake" ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"components" : {
|
"components" : {
|
||||||
|
"requestBodies" : {
|
||||||
|
"UserArray" : {
|
||||||
|
"content" : {
|
||||||
|
"application/json" : {
|
||||||
|
"schema" : {
|
||||||
|
"items" : {
|
||||||
|
"$ref" : "#/components/schemas/User"
|
||||||
|
},
|
||||||
|
"type" : "array"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description" : "List of user object",
|
||||||
|
"required" : true
|
||||||
|
},
|
||||||
|
"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",
|
||||||
|
"required" : true
|
||||||
|
}
|
||||||
|
},
|
||||||
"schemas" : {
|
"schemas" : {
|
||||||
"Order" : {
|
"Order" : {
|
||||||
"description" : "An order for a pets from the pet store",
|
"description" : "An order for a pets from the pet store",
|
||||||
@ -806,6 +883,7 @@
|
|||||||
"type" : "integer"
|
"type" : "integer"
|
||||||
},
|
},
|
||||||
"name" : {
|
"name" : {
|
||||||
|
"pattern" : "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$",
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -935,6 +1013,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"status" : {
|
"status" : {
|
||||||
|
"deprecated" : true,
|
||||||
"description" : "pet status in the store",
|
"description" : "pet status in the store",
|
||||||
"enum" : [ "available", "pending", "sold" ],
|
"enum" : [ "available", "pending", "sold" ],
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
@ -979,7 +1058,8 @@
|
|||||||
"description" : "Updated status of the pet",
|
"description" : "Updated status of the pet",
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"type" : "object"
|
||||||
},
|
},
|
||||||
"uploadFile_request" : {
|
"uploadFile_request" : {
|
||||||
"properties" : {
|
"properties" : {
|
||||||
@ -992,7 +1072,8 @@
|
|||||||
"format" : "binary",
|
"format" : "binary",
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"type" : "object"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : {
|
"securitySchemes" : {
|
||||||
@ -1014,6 +1095,5 @@
|
|||||||
"type" : "apiKey"
|
"type" : "apiKey"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"x-original-swagger-version" : "2.0"
|
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ build.sh
|
|||||||
src/Org.OpenAPITools/.gitignore
|
src/Org.OpenAPITools/.gitignore
|
||||||
src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs
|
src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs
|
||||||
src/Org.OpenAPITools/Authentication/ApiAuthentication.cs
|
src/Org.OpenAPITools/Authentication/ApiAuthentication.cs
|
||||||
|
src/Org.OpenAPITools/Controllers/FakeApi.cs
|
||||||
src/Org.OpenAPITools/Controllers/PetApi.cs
|
src/Org.OpenAPITools/Controllers/PetApi.cs
|
||||||
src/Org.OpenAPITools/Controllers/StoreApi.cs
|
src/Org.OpenAPITools/Controllers/StoreApi.cs
|
||||||
src/Org.OpenAPITools/Controllers/UserApi.cs
|
src/Org.OpenAPITools/Controllers/UserApi.cs
|
||||||
|
@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* OpenAPI Petstore
|
||||||
|
*
|
||||||
|
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
* Generated by: https://openapi-generator.tech
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Swashbuckle.AspNetCore.Annotations;
|
||||||
|
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Org.OpenAPITools.Attributes;
|
||||||
|
using Org.OpenAPITools.Models;
|
||||||
|
|
||||||
|
namespace Org.OpenAPITools.Controllers
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[ApiController]
|
||||||
|
public class FakeApiController : ControllerBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// fake endpoint to test parameter example (object)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="data"></param>
|
||||||
|
/// <response code="0">successful operation</response>
|
||||||
|
[HttpGet]
|
||||||
|
[Route("/v2/fake/parameter_example_test")]
|
||||||
|
[ValidateModelState]
|
||||||
|
[SwaggerOperation("FakeParameterExampleTest")]
|
||||||
|
public virtual IActionResult FakeParameterExampleTest([FromQuery (Name = "data")][Required()]Pet data)
|
||||||
|
{
|
||||||
|
|
||||||
|
//TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
|
// return StatusCode(0);
|
||||||
|
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -31,20 +31,31 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add a new pet to the store
|
/// Add a new pet to the store
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="body">Pet object that needs to be added to the store</param>
|
/// <param name="pet">Pet object that needs to be added to the store</param>
|
||||||
|
/// <response code="200">successful operation</response>
|
||||||
/// <response code="405">Invalid input</response>
|
/// <response code="405">Invalid input</response>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("/v2/pet")]
|
[Route("/v2/pet")]
|
||||||
[Consumes("application/json", "application/xml")]
|
[Consumes("application/json", "application/xml")]
|
||||||
[ValidateModelState]
|
[ValidateModelState]
|
||||||
[SwaggerOperation("AddPet")]
|
[SwaggerOperation("AddPet")]
|
||||||
public virtual IActionResult AddPet([FromBody]Pet body)
|
[SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")]
|
||||||
|
public virtual IActionResult AddPet([FromBody]Pet pet)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
|
// return StatusCode(200, default(Pet));
|
||||||
//TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
//TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
// return StatusCode(405);
|
// return StatusCode(405);
|
||||||
|
string exampleJson = null;
|
||||||
throw new NotImplementedException();
|
exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}";
|
||||||
|
exampleJson = "<Pet>\n <id>123456789</id>\n <name>doggie</name>\n <photoUrls>\n <photoUrls>aeiou</photoUrls>\n </photoUrls>\n <tags>\n </tags>\n <status>aeiou</status>\n</Pet>";
|
||||||
|
|
||||||
|
var example = exampleJson != null
|
||||||
|
? JsonConvert.DeserializeObject<Pet>(exampleJson)
|
||||||
|
: default(Pet);
|
||||||
|
//TODO: Change the data returned
|
||||||
|
return new ObjectResult(example);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -70,7 +81,7 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
/// Finds Pets by status
|
/// Finds Pets by status
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>Multiple status values can be provided with comma separated strings</remarks>
|
/// <remarks>Multiple status values can be provided with comma separated strings</remarks>
|
||||||
/// <param name="status">Status values that need to be considered for filter</param>
|
/// <param name="status">Status values that need to be considered for filter (deprecated)</param>
|
||||||
/// <response code="200">successful operation</response>
|
/// <response code="200">successful operation</response>
|
||||||
/// <response code="400">Invalid status value</response>
|
/// <response code="400">Invalid status value</response>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
@ -164,7 +175,8 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update an existing pet
|
/// Update an existing pet
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="body">Pet object that needs to be added to the store</param>
|
/// <param name="pet">Pet object that needs to be added to the store</param>
|
||||||
|
/// <response code="200">successful operation</response>
|
||||||
/// <response code="400">Invalid ID supplied</response>
|
/// <response code="400">Invalid ID supplied</response>
|
||||||
/// <response code="404">Pet not found</response>
|
/// <response code="404">Pet not found</response>
|
||||||
/// <response code="405">Validation exception</response>
|
/// <response code="405">Validation exception</response>
|
||||||
@ -173,17 +185,27 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
[Consumes("application/json", "application/xml")]
|
[Consumes("application/json", "application/xml")]
|
||||||
[ValidateModelState]
|
[ValidateModelState]
|
||||||
[SwaggerOperation("UpdatePet")]
|
[SwaggerOperation("UpdatePet")]
|
||||||
public virtual IActionResult UpdatePet([FromBody]Pet body)
|
[SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")]
|
||||||
|
public virtual IActionResult UpdatePet([FromBody]Pet pet)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
|
// return StatusCode(200, default(Pet));
|
||||||
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
// return StatusCode(400);
|
// return StatusCode(400);
|
||||||
//TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
//TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
// return StatusCode(404);
|
// return StatusCode(404);
|
||||||
//TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
//TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
// return StatusCode(405);
|
// return StatusCode(405);
|
||||||
|
string exampleJson = null;
|
||||||
throw new NotImplementedException();
|
exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}";
|
||||||
|
exampleJson = "<Pet>\n <id>123456789</id>\n <name>doggie</name>\n <photoUrls>\n <photoUrls>aeiou</photoUrls>\n </photoUrls>\n <tags>\n </tags>\n <status>aeiou</status>\n</Pet>";
|
||||||
|
|
||||||
|
var example = exampleJson != null
|
||||||
|
? JsonConvert.DeserializeObject<Pet>(exampleJson)
|
||||||
|
: default(Pet);
|
||||||
|
//TODO: Change the data returned
|
||||||
|
return new ObjectResult(example);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -111,15 +111,16 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Place an order for a pet
|
/// Place an order for a pet
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="body">order placed for purchasing the pet</param>
|
/// <param name="order">order placed for purchasing the pet</param>
|
||||||
/// <response code="200">successful operation</response>
|
/// <response code="200">successful operation</response>
|
||||||
/// <response code="400">Invalid Order</response>
|
/// <response code="400">Invalid Order</response>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("/v2/store/order")]
|
[Route("/v2/store/order")]
|
||||||
|
[Consumes("application/json")]
|
||||||
[ValidateModelState]
|
[ValidateModelState]
|
||||||
[SwaggerOperation("PlaceOrder")]
|
[SwaggerOperation("PlaceOrder")]
|
||||||
[SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")]
|
[SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")]
|
||||||
public virtual IActionResult PlaceOrder([FromBody]Order body)
|
public virtual IActionResult PlaceOrder([FromBody]Order order)
|
||||||
{
|
{
|
||||||
|
|
||||||
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
|
@ -32,13 +32,15 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
/// Create user
|
/// Create user
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>This can only be done by the logged in user.</remarks>
|
/// <remarks>This can only be done by the logged in user.</remarks>
|
||||||
/// <param name="body">Created user object</param>
|
/// <param name="user">Created user object</param>
|
||||||
/// <response code="0">successful operation</response>
|
/// <response code="0">successful operation</response>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("/v2/user")]
|
[Route("/v2/user")]
|
||||||
|
[Authorize(Policy = "api_key")]
|
||||||
|
[Consumes("application/json")]
|
||||||
[ValidateModelState]
|
[ValidateModelState]
|
||||||
[SwaggerOperation("CreateUser")]
|
[SwaggerOperation("CreateUser")]
|
||||||
public virtual IActionResult CreateUser([FromBody]User body)
|
public virtual IActionResult CreateUser([FromBody]User user)
|
||||||
{
|
{
|
||||||
|
|
||||||
//TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
//TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
@ -50,13 +52,15 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates list of users with given input array
|
/// Creates list of users with given input array
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="body">List of user object</param>
|
/// <param name="user">List of user object</param>
|
||||||
/// <response code="0">successful operation</response>
|
/// <response code="0">successful operation</response>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("/v2/user/createWithArray")]
|
[Route("/v2/user/createWithArray")]
|
||||||
|
[Authorize(Policy = "api_key")]
|
||||||
|
[Consumes("application/json")]
|
||||||
[ValidateModelState]
|
[ValidateModelState]
|
||||||
[SwaggerOperation("CreateUsersWithArrayInput")]
|
[SwaggerOperation("CreateUsersWithArrayInput")]
|
||||||
public virtual IActionResult CreateUsersWithArrayInput([FromBody]List<User> body)
|
public virtual IActionResult CreateUsersWithArrayInput([FromBody]List<User> user)
|
||||||
{
|
{
|
||||||
|
|
||||||
//TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
//TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
@ -68,13 +72,15 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates list of users with given input array
|
/// Creates list of users with given input array
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="body">List of user object</param>
|
/// <param name="user">List of user object</param>
|
||||||
/// <response code="0">successful operation</response>
|
/// <response code="0">successful operation</response>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("/v2/user/createWithList")]
|
[Route("/v2/user/createWithList")]
|
||||||
|
[Authorize(Policy = "api_key")]
|
||||||
|
[Consumes("application/json")]
|
||||||
[ValidateModelState]
|
[ValidateModelState]
|
||||||
[SwaggerOperation("CreateUsersWithListInput")]
|
[SwaggerOperation("CreateUsersWithListInput")]
|
||||||
public virtual IActionResult CreateUsersWithListInput([FromBody]List<User> body)
|
public virtual IActionResult CreateUsersWithListInput([FromBody]List<User> user)
|
||||||
{
|
{
|
||||||
|
|
||||||
//TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
//TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
@ -92,6 +98,7 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
/// <response code="404">User not found</response>
|
/// <response code="404">User not found</response>
|
||||||
[HttpDelete]
|
[HttpDelete]
|
||||||
[Route("/v2/user/{username}")]
|
[Route("/v2/user/{username}")]
|
||||||
|
[Authorize(Policy = "api_key")]
|
||||||
[ValidateModelState]
|
[ValidateModelState]
|
||||||
[SwaggerOperation("DeleteUser")]
|
[SwaggerOperation("DeleteUser")]
|
||||||
public virtual IActionResult DeleteUser([FromRoute (Name = "username")][Required]string username)
|
public virtual IActionResult DeleteUser([FromRoute (Name = "username")][Required]string username)
|
||||||
@ -149,7 +156,7 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
[ValidateModelState]
|
[ValidateModelState]
|
||||||
[SwaggerOperation("LoginUser")]
|
[SwaggerOperation("LoginUser")]
|
||||||
[SwaggerResponse(statusCode: 200, type: typeof(string), description: "successful operation")]
|
[SwaggerResponse(statusCode: 200, type: typeof(string), description: "successful operation")]
|
||||||
public virtual IActionResult LoginUser([FromQuery (Name = "username")][Required()]string username, [FromQuery (Name = "password")][Required()]string password)
|
public virtual IActionResult LoginUser([FromQuery (Name = "username")][Required()][RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")]string username, [FromQuery (Name = "password")][Required()]string password)
|
||||||
{
|
{
|
||||||
|
|
||||||
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
@ -171,6 +178,7 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
/// <response code="0">successful operation</response>
|
/// <response code="0">successful operation</response>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("/v2/user/logout")]
|
[Route("/v2/user/logout")]
|
||||||
|
[Authorize(Policy = "api_key")]
|
||||||
[ValidateModelState]
|
[ValidateModelState]
|
||||||
[SwaggerOperation("LogoutUser")]
|
[SwaggerOperation("LogoutUser")]
|
||||||
public virtual IActionResult LogoutUser()
|
public virtual IActionResult LogoutUser()
|
||||||
@ -187,14 +195,16 @@ namespace Org.OpenAPITools.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>This can only be done by the logged in user.</remarks>
|
/// <remarks>This can only be done by the logged in user.</remarks>
|
||||||
/// <param name="username">name that need to be deleted</param>
|
/// <param name="username">name that need to be deleted</param>
|
||||||
/// <param name="body">Updated user object</param>
|
/// <param name="user">Updated user object</param>
|
||||||
/// <response code="400">Invalid user supplied</response>
|
/// <response code="400">Invalid user supplied</response>
|
||||||
/// <response code="404">User not found</response>
|
/// <response code="404">User not found</response>
|
||||||
[HttpPut]
|
[HttpPut]
|
||||||
[Route("/v2/user/{username}")]
|
[Route("/v2/user/{username}")]
|
||||||
|
[Authorize(Policy = "api_key")]
|
||||||
|
[Consumes("application/json")]
|
||||||
[ValidateModelState]
|
[ValidateModelState]
|
||||||
[SwaggerOperation("UpdateUser")]
|
[SwaggerOperation("UpdateUser")]
|
||||||
public virtual IActionResult UpdateUser([FromRoute (Name = "username")][Required]string username, [FromBody]User body)
|
public virtual IActionResult UpdateUser([FromRoute (Name = "username")][Required]string username, [FromBody]User user)
|
||||||
{
|
{
|
||||||
|
|
||||||
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
|
@ -35,6 +35,7 @@ namespace Org.OpenAPITools.Models
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or Sets Name
|
/// Gets or Sets Name
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")]
|
||||||
[DataMember(Name="name", EmitDefaultValue=false)]
|
[DataMember(Name="name", EmitDefaultValue=false)]
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"openapi" : "3.0.1",
|
"openapi" : "3.0.0",
|
||||||
"info" : {
|
"info" : {
|
||||||
"description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.",
|
"description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.",
|
||||||
"license" : {
|
"license" : {
|
||||||
@ -9,6 +9,10 @@
|
|||||||
"title" : "OpenAPI Petstore",
|
"title" : "OpenAPI Petstore",
|
||||||
"version" : "1.0.0"
|
"version" : "1.0.0"
|
||||||
},
|
},
|
||||||
|
"externalDocs" : {
|
||||||
|
"description" : "Find out more about Swagger",
|
||||||
|
"url" : "http://swagger.io"
|
||||||
|
},
|
||||||
"servers" : [ {
|
"servers" : [ {
|
||||||
"url" : "http://petstore.swagger.io/v2"
|
"url" : "http://petstore.swagger.io/v2"
|
||||||
} ],
|
} ],
|
||||||
@ -25,26 +29,28 @@
|
|||||||
"paths" : {
|
"paths" : {
|
||||||
"/pet" : {
|
"/pet" : {
|
||||||
"post" : {
|
"post" : {
|
||||||
|
"description" : "",
|
||||||
"operationId" : "addPet",
|
"operationId" : "addPet",
|
||||||
"requestBody" : {
|
"requestBody" : {
|
||||||
"content" : {
|
"$ref" : "#/components/requestBodies/Pet"
|
||||||
"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",
|
|
||||||
"required" : true
|
|
||||||
},
|
},
|
||||||
"responses" : {
|
"responses" : {
|
||||||
|
"200" : {
|
||||||
|
"content" : {
|
||||||
|
"application/xml" : {
|
||||||
|
"schema" : {
|
||||||
|
"$ref" : "#/components/schemas/Pet"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"application/json" : {
|
||||||
|
"schema" : {
|
||||||
|
"$ref" : "#/components/schemas/Pet"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description" : "successful operation"
|
||||||
|
},
|
||||||
"405" : {
|
"405" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid input"
|
"description" : "Invalid input"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -52,38 +58,37 @@
|
|||||||
"petstore_auth" : [ "write:pets", "read:pets" ]
|
"petstore_auth" : [ "write:pets", "read:pets" ]
|
||||||
} ],
|
} ],
|
||||||
"summary" : "Add a new pet to the store",
|
"summary" : "Add a new pet to the store",
|
||||||
"tags" : [ "pet" ],
|
"tags" : [ "pet" ]
|
||||||
"x-codegen-request-body-name" : "body"
|
|
||||||
},
|
},
|
||||||
"put" : {
|
"put" : {
|
||||||
|
"description" : "",
|
||||||
"operationId" : "updatePet",
|
"operationId" : "updatePet",
|
||||||
"requestBody" : {
|
"requestBody" : {
|
||||||
"content" : {
|
"$ref" : "#/components/requestBodies/Pet"
|
||||||
"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",
|
|
||||||
"required" : true
|
|
||||||
},
|
},
|
||||||
"responses" : {
|
"responses" : {
|
||||||
|
"200" : {
|
||||||
|
"content" : {
|
||||||
|
"application/xml" : {
|
||||||
|
"schema" : {
|
||||||
|
"$ref" : "#/components/schemas/Pet"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"application/json" : {
|
||||||
|
"schema" : {
|
||||||
|
"$ref" : "#/components/schemas/Pet"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description" : "successful operation"
|
||||||
|
},
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid ID supplied"
|
"description" : "Invalid ID supplied"
|
||||||
},
|
},
|
||||||
"404" : {
|
"404" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Pet not found"
|
"description" : "Pet not found"
|
||||||
},
|
},
|
||||||
"405" : {
|
"405" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Validation exception"
|
"description" : "Validation exception"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -91,8 +96,7 @@
|
|||||||
"petstore_auth" : [ "write:pets", "read:pets" ]
|
"petstore_auth" : [ "write:pets", "read:pets" ]
|
||||||
} ],
|
} ],
|
||||||
"summary" : "Update an existing pet",
|
"summary" : "Update an existing pet",
|
||||||
"tags" : [ "pet" ],
|
"tags" : [ "pet" ]
|
||||||
"x-codegen-request-body-name" : "body"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/pet/findByStatus" : {
|
"/pet/findByStatus" : {
|
||||||
@ -100,6 +104,7 @@
|
|||||||
"description" : "Multiple status values can be provided with comma separated strings",
|
"description" : "Multiple status values can be provided with comma separated strings",
|
||||||
"operationId" : "findPetsByStatus",
|
"operationId" : "findPetsByStatus",
|
||||||
"parameters" : [ {
|
"parameters" : [ {
|
||||||
|
"deprecated" : true,
|
||||||
"description" : "Status values that need to be considered for filter",
|
"description" : "Status values that need to be considered for filter",
|
||||||
"explode" : false,
|
"explode" : false,
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
@ -138,12 +143,11 @@
|
|||||||
"description" : "successful operation"
|
"description" : "successful operation"
|
||||||
},
|
},
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid status value"
|
"description" : "Invalid status value"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"security" : [ {
|
"security" : [ {
|
||||||
"petstore_auth" : [ "write:pets", "read:pets" ]
|
"petstore_auth" : [ "read:pets" ]
|
||||||
} ],
|
} ],
|
||||||
"summary" : "Finds Pets by status",
|
"summary" : "Finds Pets by status",
|
||||||
"tags" : [ "pet" ]
|
"tags" : [ "pet" ]
|
||||||
@ -191,12 +195,11 @@
|
|||||||
"description" : "successful operation"
|
"description" : "successful operation"
|
||||||
},
|
},
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid tag value"
|
"description" : "Invalid tag value"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"security" : [ {
|
"security" : [ {
|
||||||
"petstore_auth" : [ "write:pets", "read:pets" ]
|
"petstore_auth" : [ "read:pets" ]
|
||||||
} ],
|
} ],
|
||||||
"summary" : "Finds Pets by tags",
|
"summary" : "Finds Pets by tags",
|
||||||
"tags" : [ "pet" ]
|
"tags" : [ "pet" ]
|
||||||
@ -204,26 +207,31 @@
|
|||||||
},
|
},
|
||||||
"/pet/{petId}" : {
|
"/pet/{petId}" : {
|
||||||
"delete" : {
|
"delete" : {
|
||||||
|
"description" : "",
|
||||||
"operationId" : "deletePet",
|
"operationId" : "deletePet",
|
||||||
"parameters" : [ {
|
"parameters" : [ {
|
||||||
|
"explode" : false,
|
||||||
"in" : "header",
|
"in" : "header",
|
||||||
"name" : "api_key",
|
"name" : "api_key",
|
||||||
|
"required" : false,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
}, {
|
}, {
|
||||||
"description" : "Pet id to delete",
|
"description" : "Pet id to delete",
|
||||||
|
"explode" : false,
|
||||||
"in" : "path",
|
"in" : "path",
|
||||||
"name" : "petId",
|
"name" : "petId",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int64",
|
"format" : "int64",
|
||||||
"type" : "integer"
|
"type" : "integer"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
} ],
|
} ],
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid pet value"
|
"description" : "Invalid pet value"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -238,13 +246,15 @@
|
|||||||
"operationId" : "getPetById",
|
"operationId" : "getPetById",
|
||||||
"parameters" : [ {
|
"parameters" : [ {
|
||||||
"description" : "ID of pet to return",
|
"description" : "ID of pet to return",
|
||||||
|
"explode" : false,
|
||||||
"in" : "path",
|
"in" : "path",
|
||||||
"name" : "petId",
|
"name" : "petId",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int64",
|
"format" : "int64",
|
||||||
"type" : "integer"
|
"type" : "integer"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
} ],
|
} ],
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"200" : {
|
"200" : {
|
||||||
@ -263,11 +273,9 @@
|
|||||||
"description" : "successful operation"
|
"description" : "successful operation"
|
||||||
},
|
},
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid ID supplied"
|
"description" : "Invalid ID supplied"
|
||||||
},
|
},
|
||||||
"404" : {
|
"404" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Pet not found"
|
"description" : "Pet not found"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -278,16 +286,19 @@
|
|||||||
"tags" : [ "pet" ]
|
"tags" : [ "pet" ]
|
||||||
},
|
},
|
||||||
"post" : {
|
"post" : {
|
||||||
|
"description" : "",
|
||||||
"operationId" : "updatePetWithForm",
|
"operationId" : "updatePetWithForm",
|
||||||
"parameters" : [ {
|
"parameters" : [ {
|
||||||
"description" : "ID of pet that needs to be updated",
|
"description" : "ID of pet that needs to be updated",
|
||||||
|
"explode" : false,
|
||||||
"in" : "path",
|
"in" : "path",
|
||||||
"name" : "petId",
|
"name" : "petId",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int64",
|
"format" : "int64",
|
||||||
"type" : "integer"
|
"type" : "integer"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
} ],
|
} ],
|
||||||
"requestBody" : {
|
"requestBody" : {
|
||||||
"content" : {
|
"content" : {
|
||||||
@ -300,7 +311,6 @@
|
|||||||
},
|
},
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"405" : {
|
"405" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid input"
|
"description" : "Invalid input"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -313,16 +323,19 @@
|
|||||||
},
|
},
|
||||||
"/pet/{petId}/uploadImage" : {
|
"/pet/{petId}/uploadImage" : {
|
||||||
"post" : {
|
"post" : {
|
||||||
|
"description" : "",
|
||||||
"operationId" : "uploadFile",
|
"operationId" : "uploadFile",
|
||||||
"parameters" : [ {
|
"parameters" : [ {
|
||||||
"description" : "ID of pet to update",
|
"description" : "ID of pet to update",
|
||||||
|
"explode" : false,
|
||||||
"in" : "path",
|
"in" : "path",
|
||||||
"name" : "petId",
|
"name" : "petId",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int64",
|
"format" : "int64",
|
||||||
"type" : "integer"
|
"type" : "integer"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
} ],
|
} ],
|
||||||
"requestBody" : {
|
"requestBody" : {
|
||||||
"content" : {
|
"content" : {
|
||||||
@ -381,10 +394,11 @@
|
|||||||
},
|
},
|
||||||
"/store/order" : {
|
"/store/order" : {
|
||||||
"post" : {
|
"post" : {
|
||||||
|
"description" : "",
|
||||||
"operationId" : "placeOrder",
|
"operationId" : "placeOrder",
|
||||||
"requestBody" : {
|
"requestBody" : {
|
||||||
"content" : {
|
"content" : {
|
||||||
"*/*" : {
|
"application/json" : {
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"$ref" : "#/components/schemas/Order"
|
"$ref" : "#/components/schemas/Order"
|
||||||
}
|
}
|
||||||
@ -410,13 +424,11 @@
|
|||||||
"description" : "successful operation"
|
"description" : "successful operation"
|
||||||
},
|
},
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid Order"
|
"description" : "Invalid Order"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"summary" : "Place an order for a pet",
|
"summary" : "Place an order for a pet",
|
||||||
"tags" : [ "store" ],
|
"tags" : [ "store" ]
|
||||||
"x-codegen-request-body-name" : "body"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/store/order/{orderId}" : {
|
"/store/order/{orderId}" : {
|
||||||
@ -425,20 +437,20 @@
|
|||||||
"operationId" : "deleteOrder",
|
"operationId" : "deleteOrder",
|
||||||
"parameters" : [ {
|
"parameters" : [ {
|
||||||
"description" : "ID of the order that needs to be deleted",
|
"description" : "ID of the order that needs to be deleted",
|
||||||
|
"explode" : false,
|
||||||
"in" : "path",
|
"in" : "path",
|
||||||
"name" : "orderId",
|
"name" : "orderId",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
} ],
|
} ],
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid ID supplied"
|
"description" : "Invalid ID supplied"
|
||||||
},
|
},
|
||||||
"404" : {
|
"404" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Order not found"
|
"description" : "Order not found"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -450,6 +462,7 @@
|
|||||||
"operationId" : "getOrderById",
|
"operationId" : "getOrderById",
|
||||||
"parameters" : [ {
|
"parameters" : [ {
|
||||||
"description" : "ID of pet that needs to be fetched",
|
"description" : "ID of pet that needs to be fetched",
|
||||||
|
"explode" : false,
|
||||||
"in" : "path",
|
"in" : "path",
|
||||||
"name" : "orderId",
|
"name" : "orderId",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
@ -458,7 +471,8 @@
|
|||||||
"maximum" : 5,
|
"maximum" : 5,
|
||||||
"minimum" : 1,
|
"minimum" : 1,
|
||||||
"type" : "integer"
|
"type" : "integer"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
} ],
|
} ],
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"200" : {
|
"200" : {
|
||||||
@ -477,11 +491,9 @@
|
|||||||
"description" : "successful operation"
|
"description" : "successful operation"
|
||||||
},
|
},
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid ID supplied"
|
"description" : "Invalid ID supplied"
|
||||||
},
|
},
|
||||||
"404" : {
|
"404" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Order not found"
|
"description" : "Order not found"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -495,7 +507,7 @@
|
|||||||
"operationId" : "createUser",
|
"operationId" : "createUser",
|
||||||
"requestBody" : {
|
"requestBody" : {
|
||||||
"content" : {
|
"content" : {
|
||||||
"*/*" : {
|
"application/json" : {
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"$ref" : "#/components/schemas/User"
|
"$ref" : "#/components/schemas/User"
|
||||||
}
|
}
|
||||||
@ -506,90 +518,79 @@
|
|||||||
},
|
},
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"default" : {
|
"default" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "successful operation"
|
"description" : "successful operation"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"security" : [ {
|
||||||
|
"api_key" : [ ]
|
||||||
|
} ],
|
||||||
"summary" : "Create user",
|
"summary" : "Create user",
|
||||||
"tags" : [ "user" ],
|
"tags" : [ "user" ]
|
||||||
"x-codegen-request-body-name" : "body"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/user/createWithArray" : {
|
"/user/createWithArray" : {
|
||||||
"post" : {
|
"post" : {
|
||||||
|
"description" : "",
|
||||||
"operationId" : "createUsersWithArrayInput",
|
"operationId" : "createUsersWithArrayInput",
|
||||||
"requestBody" : {
|
"requestBody" : {
|
||||||
"content" : {
|
"$ref" : "#/components/requestBodies/UserArray"
|
||||||
"*/*" : {
|
|
||||||
"schema" : {
|
|
||||||
"items" : {
|
|
||||||
"$ref" : "#/components/schemas/User"
|
|
||||||
},
|
|
||||||
"type" : "array"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"description" : "List of user object",
|
|
||||||
"required" : true
|
|
||||||
},
|
},
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"default" : {
|
"default" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "successful operation"
|
"description" : "successful operation"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"security" : [ {
|
||||||
|
"api_key" : [ ]
|
||||||
|
} ],
|
||||||
"summary" : "Creates list of users with given input array",
|
"summary" : "Creates list of users with given input array",
|
||||||
"tags" : [ "user" ],
|
"tags" : [ "user" ]
|
||||||
"x-codegen-request-body-name" : "body"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/user/createWithList" : {
|
"/user/createWithList" : {
|
||||||
"post" : {
|
"post" : {
|
||||||
|
"description" : "",
|
||||||
"operationId" : "createUsersWithListInput",
|
"operationId" : "createUsersWithListInput",
|
||||||
"requestBody" : {
|
"requestBody" : {
|
||||||
"content" : {
|
"$ref" : "#/components/requestBodies/UserArray"
|
||||||
"*/*" : {
|
|
||||||
"schema" : {
|
|
||||||
"items" : {
|
|
||||||
"$ref" : "#/components/schemas/User"
|
|
||||||
},
|
|
||||||
"type" : "array"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"description" : "List of user object",
|
|
||||||
"required" : true
|
|
||||||
},
|
},
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"default" : {
|
"default" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "successful operation"
|
"description" : "successful operation"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"security" : [ {
|
||||||
|
"api_key" : [ ]
|
||||||
|
} ],
|
||||||
"summary" : "Creates list of users with given input array",
|
"summary" : "Creates list of users with given input array",
|
||||||
"tags" : [ "user" ],
|
"tags" : [ "user" ]
|
||||||
"x-codegen-request-body-name" : "body"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/user/login" : {
|
"/user/login" : {
|
||||||
"get" : {
|
"get" : {
|
||||||
|
"description" : "",
|
||||||
"operationId" : "loginUser",
|
"operationId" : "loginUser",
|
||||||
"parameters" : [ {
|
"parameters" : [ {
|
||||||
"description" : "The user name for login",
|
"description" : "The user name for login",
|
||||||
|
"explode" : true,
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
"name" : "username",
|
"name" : "username",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
|
"pattern" : "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$",
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
},
|
||||||
|
"style" : "form"
|
||||||
}, {
|
}, {
|
||||||
"description" : "The password for login in clear text",
|
"description" : "The password for login in clear text",
|
||||||
|
"explode" : true,
|
||||||
"in" : "query",
|
"in" : "query",
|
||||||
"name" : "password",
|
"name" : "password",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
},
|
||||||
|
"style" : "form"
|
||||||
} ],
|
} ],
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"200" : {
|
"200" : {
|
||||||
@ -607,24 +608,36 @@
|
|||||||
},
|
},
|
||||||
"description" : "successful operation",
|
"description" : "successful operation",
|
||||||
"headers" : {
|
"headers" : {
|
||||||
|
"Set-Cookie" : {
|
||||||
|
"description" : "Cookie authentication key for use with the `api_key` apiKey authentication.",
|
||||||
|
"explode" : false,
|
||||||
|
"schema" : {
|
||||||
|
"example" : "AUTH_KEY=abcde12345; Path=/; HttpOnly",
|
||||||
|
"type" : "string"
|
||||||
|
},
|
||||||
|
"style" : "simple"
|
||||||
|
},
|
||||||
"X-Rate-Limit" : {
|
"X-Rate-Limit" : {
|
||||||
"description" : "calls per hour allowed by the user",
|
"description" : "calls per hour allowed by the user",
|
||||||
|
"explode" : false,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "int32",
|
"format" : "int32",
|
||||||
"type" : "integer"
|
"type" : "integer"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
},
|
},
|
||||||
"X-Expires-After" : {
|
"X-Expires-After" : {
|
||||||
"description" : "date in UTC when token expires",
|
"description" : "date in UTC when token expires",
|
||||||
|
"explode" : false,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"format" : "date-time",
|
"format" : "date-time",
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid username/password supplied"
|
"description" : "Invalid username/password supplied"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -634,13 +647,16 @@
|
|||||||
},
|
},
|
||||||
"/user/logout" : {
|
"/user/logout" : {
|
||||||
"get" : {
|
"get" : {
|
||||||
|
"description" : "",
|
||||||
"operationId" : "logoutUser",
|
"operationId" : "logoutUser",
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"default" : {
|
"default" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "successful operation"
|
"description" : "successful operation"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"security" : [ {
|
||||||
|
"api_key" : [ ]
|
||||||
|
} ],
|
||||||
"summary" : "Logs out current logged in user session",
|
"summary" : "Logs out current logged in user session",
|
||||||
"tags" : [ "user" ]
|
"tags" : [ "user" ]
|
||||||
}
|
}
|
||||||
@ -651,36 +667,42 @@
|
|||||||
"operationId" : "deleteUser",
|
"operationId" : "deleteUser",
|
||||||
"parameters" : [ {
|
"parameters" : [ {
|
||||||
"description" : "The name that needs to be deleted",
|
"description" : "The name that needs to be deleted",
|
||||||
|
"explode" : false,
|
||||||
"in" : "path",
|
"in" : "path",
|
||||||
"name" : "username",
|
"name" : "username",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
} ],
|
} ],
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid username supplied"
|
"description" : "Invalid username supplied"
|
||||||
},
|
},
|
||||||
"404" : {
|
"404" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "User not found"
|
"description" : "User not found"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"security" : [ {
|
||||||
|
"api_key" : [ ]
|
||||||
|
} ],
|
||||||
"summary" : "Delete user",
|
"summary" : "Delete user",
|
||||||
"tags" : [ "user" ]
|
"tags" : [ "user" ]
|
||||||
},
|
},
|
||||||
"get" : {
|
"get" : {
|
||||||
|
"description" : "",
|
||||||
"operationId" : "getUserByName",
|
"operationId" : "getUserByName",
|
||||||
"parameters" : [ {
|
"parameters" : [ {
|
||||||
"description" : "The name that needs to be fetched. Use user1 for testing.",
|
"description" : "The name that needs to be fetched. Use user1 for testing.",
|
||||||
|
"explode" : false,
|
||||||
"in" : "path",
|
"in" : "path",
|
||||||
"name" : "username",
|
"name" : "username",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
} ],
|
} ],
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"200" : {
|
"200" : {
|
||||||
@ -699,11 +721,9 @@
|
|||||||
"description" : "successful operation"
|
"description" : "successful operation"
|
||||||
},
|
},
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid username supplied"
|
"description" : "Invalid username supplied"
|
||||||
},
|
},
|
||||||
"404" : {
|
"404" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "User not found"
|
"description" : "User not found"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -715,16 +735,18 @@
|
|||||||
"operationId" : "updateUser",
|
"operationId" : "updateUser",
|
||||||
"parameters" : [ {
|
"parameters" : [ {
|
||||||
"description" : "name that need to be deleted",
|
"description" : "name that need to be deleted",
|
||||||
|
"explode" : false,
|
||||||
"in" : "path",
|
"in" : "path",
|
||||||
"name" : "username",
|
"name" : "username",
|
||||||
"required" : true,
|
"required" : true,
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
},
|
||||||
|
"style" : "simple"
|
||||||
} ],
|
} ],
|
||||||
"requestBody" : {
|
"requestBody" : {
|
||||||
"content" : {
|
"content" : {
|
||||||
"*/*" : {
|
"application/json" : {
|
||||||
"schema" : {
|
"schema" : {
|
||||||
"$ref" : "#/components/schemas/User"
|
"$ref" : "#/components/schemas/User"
|
||||||
}
|
}
|
||||||
@ -735,21 +757,76 @@
|
|||||||
},
|
},
|
||||||
"responses" : {
|
"responses" : {
|
||||||
"400" : {
|
"400" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "Invalid user supplied"
|
"description" : "Invalid user supplied"
|
||||||
},
|
},
|
||||||
"404" : {
|
"404" : {
|
||||||
"content" : { },
|
|
||||||
"description" : "User not found"
|
"description" : "User not found"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"security" : [ {
|
||||||
|
"api_key" : [ ]
|
||||||
|
} ],
|
||||||
"summary" : "Updated user",
|
"summary" : "Updated user",
|
||||||
"tags" : [ "user" ],
|
"tags" : [ "user" ]
|
||||||
"x-codegen-request-body-name" : "body"
|
}
|
||||||
|
},
|
||||||
|
"/fake/parameter_example_test" : {
|
||||||
|
"get" : {
|
||||||
|
"description" : "",
|
||||||
|
"operationId" : "fake_parameter_example_test",
|
||||||
|
"parameters" : [ {
|
||||||
|
"explode" : true,
|
||||||
|
"in" : "query",
|
||||||
|
"name" : "data",
|
||||||
|
"required" : true,
|
||||||
|
"schema" : {
|
||||||
|
"$ref" : "#/components/schemas/Pet"
|
||||||
|
},
|
||||||
|
"style" : "form"
|
||||||
|
} ],
|
||||||
|
"responses" : {
|
||||||
|
"default" : {
|
||||||
|
"description" : "successful operation"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"summary" : "fake endpoint to test parameter example (object)",
|
||||||
|
"tags" : [ "fake" ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"components" : {
|
"components" : {
|
||||||
|
"requestBodies" : {
|
||||||
|
"UserArray" : {
|
||||||
|
"content" : {
|
||||||
|
"application/json" : {
|
||||||
|
"schema" : {
|
||||||
|
"items" : {
|
||||||
|
"$ref" : "#/components/schemas/User"
|
||||||
|
},
|
||||||
|
"type" : "array"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description" : "List of user object",
|
||||||
|
"required" : true
|
||||||
|
},
|
||||||
|
"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",
|
||||||
|
"required" : true
|
||||||
|
}
|
||||||
|
},
|
||||||
"schemas" : {
|
"schemas" : {
|
||||||
"Order" : {
|
"Order" : {
|
||||||
"description" : "An order for a pets from the pet store",
|
"description" : "An order for a pets from the pet store",
|
||||||
@ -806,6 +883,7 @@
|
|||||||
"type" : "integer"
|
"type" : "integer"
|
||||||
},
|
},
|
||||||
"name" : {
|
"name" : {
|
||||||
|
"pattern" : "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$",
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -935,6 +1013,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"status" : {
|
"status" : {
|
||||||
|
"deprecated" : true,
|
||||||
"description" : "pet status in the store",
|
"description" : "pet status in the store",
|
||||||
"enum" : [ "available", "pending", "sold" ],
|
"enum" : [ "available", "pending", "sold" ],
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
@ -979,7 +1058,8 @@
|
|||||||
"description" : "Updated status of the pet",
|
"description" : "Updated status of the pet",
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"type" : "object"
|
||||||
},
|
},
|
||||||
"uploadFile_request" : {
|
"uploadFile_request" : {
|
||||||
"properties" : {
|
"properties" : {
|
||||||
@ -992,7 +1072,8 @@
|
|||||||
"format" : "binary",
|
"format" : "binary",
|
||||||
"type" : "string"
|
"type" : "string"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"type" : "object"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"securitySchemes" : {
|
"securitySchemes" : {
|
||||||
@ -1014,6 +1095,5 @@
|
|||||||
"type" : "apiKey"
|
"type" : "apiKey"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"x-original-swagger-version" : "2.0"
|
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ build.sh
|
|||||||
src/Org.OpenAPITools/.gitignore
|
src/Org.OpenAPITools/.gitignore
|
||||||
src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs
|
src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs
|
||||||
src/Org.OpenAPITools/Authentication/ApiAuthentication.cs
|
src/Org.OpenAPITools/Authentication/ApiAuthentication.cs
|
||||||
|
src/Org.OpenAPITools/Controllers/FakeApi.cs
|
||||||
src/Org.OpenAPITools/Controllers/PetApi.cs
|
src/Org.OpenAPITools/Controllers/PetApi.cs
|
||||||
src/Org.OpenAPITools/Controllers/StoreApi.cs
|
src/Org.OpenAPITools/Controllers/StoreApi.cs
|
||||||
src/Org.OpenAPITools/Controllers/UserApi.cs
|
src/Org.OpenAPITools/Controllers/UserApi.cs
|
||||||
|
@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* OpenAPI Petstore
|
||||||
|
*
|
||||||
|
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
* Generated by: https://openapi-generator.tech
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Swashbuckle.AspNetCore.Annotations;
|
||||||
|
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Org.OpenAPITools.Attributes;
|
||||||
|
using Org.OpenAPITools.Models;
|
||||||
|
|
||||||
|
namespace Org.OpenAPITools.Controllers
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[ApiController]
|
||||||
|
public class FakeApiController : ControllerBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// fake endpoint to test parameter example (object)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="data"></param>
|
||||||
|
/// <response code="0">successful operation</response>
|
||||||
|
[HttpGet]
|
||||||
|
[Route("/v2/fake/parameter_example_test")]
|
||||||
|
[ValidateModelState]
|
||||||
|
[SwaggerOperation("FakeParameterExampleTest")]
|
||||||
|
public virtual IActionResult FakeParameterExampleTest([FromQuery (Name = "data")][Required()]Pet data)
|
||||||
|
{
|
||||||
|
|
||||||
|
//TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
|
// return StatusCode(0);
|
||||||
|
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -769,6 +769,29 @@
|
|||||||
"summary" : "Updated user",
|
"summary" : "Updated user",
|
||||||
"tags" : [ "user" ]
|
"tags" : [ "user" ]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"/fake/parameter_example_test" : {
|
||||||
|
"get" : {
|
||||||
|
"description" : "",
|
||||||
|
"operationId" : "fake_parameter_example_test",
|
||||||
|
"parameters" : [ {
|
||||||
|
"explode" : true,
|
||||||
|
"in" : "query",
|
||||||
|
"name" : "data",
|
||||||
|
"required" : true,
|
||||||
|
"schema" : {
|
||||||
|
"$ref" : "#/components/schemas/Pet"
|
||||||
|
},
|
||||||
|
"style" : "form"
|
||||||
|
} ],
|
||||||
|
"responses" : {
|
||||||
|
"default" : {
|
||||||
|
"description" : "successful operation"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"summary" : "fake endpoint to test parameter example (object)",
|
||||||
|
"tags" : [ "fake" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"components" : {
|
"components" : {
|
||||||
|
@ -5,6 +5,7 @@ build.sh
|
|||||||
src/Org.OpenAPITools/.gitignore
|
src/Org.OpenAPITools/.gitignore
|
||||||
src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs
|
src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs
|
||||||
src/Org.OpenAPITools/Authentication/ApiAuthentication.cs
|
src/Org.OpenAPITools/Authentication/ApiAuthentication.cs
|
||||||
|
src/Org.OpenAPITools/Controllers/FakeApi.cs
|
||||||
src/Org.OpenAPITools/Controllers/PetApi.cs
|
src/Org.OpenAPITools/Controllers/PetApi.cs
|
||||||
src/Org.OpenAPITools/Controllers/StoreApi.cs
|
src/Org.OpenAPITools/Controllers/StoreApi.cs
|
||||||
src/Org.OpenAPITools/Controllers/UserApi.cs
|
src/Org.OpenAPITools/Controllers/UserApi.cs
|
||||||
|
@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* OpenAPI Petstore
|
||||||
|
*
|
||||||
|
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.0.0
|
||||||
|
*
|
||||||
|
* Generated by: https://openapi-generator.tech
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Swashbuckle.AspNetCore.Annotations;
|
||||||
|
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Org.OpenAPITools.Attributes;
|
||||||
|
using Org.OpenAPITools.Models;
|
||||||
|
|
||||||
|
namespace Org.OpenAPITools.Controllers
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
[ApiController]
|
||||||
|
public class FakeApiController : ControllerBase
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// fake endpoint to test parameter example (object)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="data"></param>
|
||||||
|
/// <response code="0">successful operation</response>
|
||||||
|
[HttpGet]
|
||||||
|
[Route("/v2/fake/parameter_example_test")]
|
||||||
|
[ValidateModelState]
|
||||||
|
[SwaggerOperation("FakeParameterExampleTest")]
|
||||||
|
public virtual IActionResult FakeParameterExampleTest([FromQuery (Name = "data")][Required()]Pet data)
|
||||||
|
{
|
||||||
|
|
||||||
|
//TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||||||
|
// return StatusCode(0);
|
||||||
|
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -769,6 +769,29 @@
|
|||||||
"summary" : "Updated user",
|
"summary" : "Updated user",
|
||||||
"tags" : [ "user" ]
|
"tags" : [ "user" ]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"/fake/parameter_example_test" : {
|
||||||
|
"get" : {
|
||||||
|
"description" : "",
|
||||||
|
"operationId" : "fake_parameter_example_test",
|
||||||
|
"parameters" : [ {
|
||||||
|
"explode" : true,
|
||||||
|
"in" : "query",
|
||||||
|
"name" : "data",
|
||||||
|
"required" : true,
|
||||||
|
"schema" : {
|
||||||
|
"$ref" : "#/components/schemas/Pet"
|
||||||
|
},
|
||||||
|
"style" : "form"
|
||||||
|
} ],
|
||||||
|
"responses" : {
|
||||||
|
"default" : {
|
||||||
|
"description" : "successful operation"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"summary" : "fake endpoint to test parameter example (object)",
|
||||||
|
"tags" : [ "fake" ]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"components" : {
|
"components" : {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user