forked from loafle/openapi-generator-original
clean up kotlin spring samples (#20445)
* clean up samples * use 3.0 petstore test spec * update samples * better code format
This commit is contained in:
@@ -40,16 +40,18 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
operationId = "addPet",
|
||||
description = """""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = Pet::class))]),
|
||||
ApiResponse(responseCode = "405", description = "Invalid input") ],
|
||||
security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "write:pets", "read:pets" ]) ]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.POST],
|
||||
value = ["/pet"],
|
||||
produces = ["application/xml", "application/json"],
|
||||
consumes = ["application/json", "application/xml"]
|
||||
)
|
||||
suspend fun addPet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody body: Pet): ResponseEntity<Unit> {
|
||||
return ResponseEntity(service.addPet(body), HttpStatus.valueOf(405))
|
||||
suspend fun addPet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet): ResponseEntity<Pet> {
|
||||
return ResponseEntity(service.addPet(pet), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
@Operation(
|
||||
@@ -75,7 +77,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
responses = [
|
||||
ApiResponse(responseCode = "200", description = "successful operation", content = [Content(array = ArraySchema(schema = Schema(implementation = Pet::class)))]),
|
||||
ApiResponse(responseCode = "400", description = "Invalid status value") ],
|
||||
security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "write:pets", "read:pets" ]) ]
|
||||
security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "read:pets" ]) ]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.GET],
|
||||
@@ -93,7 +95,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
responses = [
|
||||
ApiResponse(responseCode = "200", description = "successful operation", content = [Content(array = ArraySchema(schema = Schema(implementation = Pet::class)))]),
|
||||
ApiResponse(responseCode = "400", description = "Invalid tag value") ],
|
||||
security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "write:pets", "read:pets" ]) ]
|
||||
security = [ SecurityRequirement(name = "petstore_auth", scopes = [ "read:pets" ]) ]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.GET],
|
||||
@@ -128,6 +130,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
operationId = "updatePet",
|
||||
description = """""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "200", description = "successful operation", content = [Content(schema = Schema(implementation = Pet::class))]),
|
||||
ApiResponse(responseCode = "400", description = "Invalid ID supplied"),
|
||||
ApiResponse(responseCode = "404", description = "Pet not found"),
|
||||
ApiResponse(responseCode = "405", description = "Validation exception") ],
|
||||
@@ -136,10 +139,11 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) {
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.PUT],
|
||||
value = ["/pet"],
|
||||
produces = ["application/xml", "application/json"],
|
||||
consumes = ["application/json", "application/xml"]
|
||||
)
|
||||
suspend fun updatePet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody body: Pet): ResponseEntity<Unit> {
|
||||
return ResponseEntity(service.updatePet(body), HttpStatus.valueOf(400))
|
||||
suspend fun updatePet(@Parameter(description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody pet: Pet): ResponseEntity<Pet> {
|
||||
return ResponseEntity(service.updatePet(pet), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
@Operation(
|
||||
|
||||
@@ -8,15 +8,18 @@ interface PetApiService {
|
||||
|
||||
/**
|
||||
* POST /pet : Add a new pet to the store
|
||||
*
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store (required)
|
||||
* @return Invalid input (status code 405)
|
||||
* @param pet Pet object that needs to be added to the store (required)
|
||||
* @return successful operation (status code 200)
|
||||
* or Invalid input (status code 405)
|
||||
* @see PetApi#addPet
|
||||
*/
|
||||
suspend fun addPet(body: Pet): Unit
|
||||
suspend fun addPet(pet: Pet): Pet
|
||||
|
||||
/**
|
||||
* DELETE /pet/{petId} : Deletes a pet
|
||||
*
|
||||
*
|
||||
* @param petId Pet id to delete (required)
|
||||
* @param apiKey (optional)
|
||||
@@ -62,17 +65,22 @@ interface PetApiService {
|
||||
|
||||
/**
|
||||
* PUT /pet : Update an existing pet
|
||||
*
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store (required)
|
||||
* @return Invalid ID supplied (status code 400)
|
||||
* @param pet Pet object that needs to be added to the store (required)
|
||||
* @return successful operation (status code 200)
|
||||
* or Invalid ID supplied (status code 400)
|
||||
* or Pet not found (status code 404)
|
||||
* or Validation exception (status code 405)
|
||||
* API documentation for the updatePet operation
|
||||
* @see <a href="http://petstore.swagger.io/v2/doc/updatePet">Update an existing pet Documentation</a>
|
||||
* @see PetApi#updatePet
|
||||
*/
|
||||
suspend fun updatePet(body: Pet): Unit
|
||||
suspend fun updatePet(pet: Pet): Pet
|
||||
|
||||
/**
|
||||
* POST /pet/{petId} : Updates a pet in the store with form data
|
||||
*
|
||||
*
|
||||
* @param petId ID of pet that needs to be updated (required)
|
||||
* @param name Updated name of the pet (optional)
|
||||
@@ -84,6 +92,7 @@ interface PetApiService {
|
||||
|
||||
/**
|
||||
* POST /pet/{petId}/uploadImage : uploads an image
|
||||
*
|
||||
*
|
||||
* @param petId ID of pet to update (required)
|
||||
* @param additionalMetadata Additional data to pass to server (optional)
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.springframework.stereotype.Service
|
||||
@Service
|
||||
class PetApiServiceImpl : PetApiService {
|
||||
|
||||
override suspend fun addPet(body: Pet): Unit {
|
||||
override suspend fun addPet(pet: Pet): Pet {
|
||||
TODO("Implement me")
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ class PetApiServiceImpl : PetApiService {
|
||||
TODO("Implement me")
|
||||
}
|
||||
|
||||
override suspend fun updatePet(body: Pet): Unit {
|
||||
override suspend fun updatePet(pet: Pet): Pet {
|
||||
TODO("Implement me")
|
||||
}
|
||||
|
||||
|
||||
@@ -96,9 +96,10 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.POST],
|
||||
value = ["/store/order"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
produces = ["application/xml", "application/json"],
|
||||
consumes = ["application/json"]
|
||||
)
|
||||
suspend fun placeOrder(@Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody body: Order): ResponseEntity<Order> {
|
||||
return ResponseEntity(service.placeOrder(body), HttpStatus.valueOf(200))
|
||||
suspend fun placeOrder(@Parameter(description = "order placed for purchasing the pet", required = true) @Valid @RequestBody order: Order): ResponseEntity<Order> {
|
||||
return ResponseEntity(service.placeOrder(order), HttpStatus.valueOf(200))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,11 +39,12 @@ interface StoreApiService {
|
||||
|
||||
/**
|
||||
* POST /store/order : Place an order for a pet
|
||||
*
|
||||
*
|
||||
* @param body order placed for purchasing the pet (required)
|
||||
* @param order order placed for purchasing the pet (required)
|
||||
* @return successful operation (status code 200)
|
||||
* or Invalid Order (status code 400)
|
||||
* @see StoreApi#placeOrder
|
||||
*/
|
||||
suspend fun placeOrder(body: Order): Order
|
||||
suspend fun placeOrder(order: Order): Order
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ class StoreApiServiceImpl : StoreApiService {
|
||||
TODO("Implement me")
|
||||
}
|
||||
|
||||
override suspend fun placeOrder(body: Order): Order {
|
||||
override suspend fun placeOrder(order: Order): Order {
|
||||
TODO("Implement me")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,14 +39,16 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
|
||||
operationId = "createUser",
|
||||
description = """This can only be done by the logged in user.""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "200", description = "successful operation") ]
|
||||
ApiResponse(responseCode = "200", description = "successful operation") ],
|
||||
security = [ SecurityRequirement(name = "api_key") ]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.POST],
|
||||
value = ["/user"]
|
||||
value = ["/user"],
|
||||
consumes = ["application/json"]
|
||||
)
|
||||
suspend fun createUser(@Parameter(description = "Created user object", required = true) @Valid @RequestBody body: User): ResponseEntity<Unit> {
|
||||
return ResponseEntity(service.createUser(body), HttpStatus.valueOf(200))
|
||||
suspend fun createUser(@Parameter(description = "Created user object", required = true) @Valid @RequestBody user: User): ResponseEntity<Unit> {
|
||||
return ResponseEntity(service.createUser(user), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
@Operation(
|
||||
@@ -54,14 +56,16 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
|
||||
operationId = "createUsersWithArrayInput",
|
||||
description = """""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "200", description = "successful operation") ]
|
||||
ApiResponse(responseCode = "200", description = "successful operation") ],
|
||||
security = [ SecurityRequirement(name = "api_key") ]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.POST],
|
||||
value = ["/user/createWithArray"]
|
||||
value = ["/user/createWithArray"],
|
||||
consumes = ["application/json"]
|
||||
)
|
||||
suspend fun createUsersWithArrayInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody body: Flow<User>): ResponseEntity<Unit> {
|
||||
return ResponseEntity(service.createUsersWithArrayInput(body), HttpStatus.valueOf(200))
|
||||
suspend fun createUsersWithArrayInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody user: Flow<User>): ResponseEntity<Unit> {
|
||||
return ResponseEntity(service.createUsersWithArrayInput(user), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
@Operation(
|
||||
@@ -69,14 +73,16 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
|
||||
operationId = "createUsersWithListInput",
|
||||
description = """""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "200", description = "successful operation") ]
|
||||
ApiResponse(responseCode = "200", description = "successful operation") ],
|
||||
security = [ SecurityRequirement(name = "api_key") ]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.POST],
|
||||
value = ["/user/createWithList"]
|
||||
value = ["/user/createWithList"],
|
||||
consumes = ["application/json"]
|
||||
)
|
||||
suspend fun createUsersWithListInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody body: Flow<User>): ResponseEntity<Unit> {
|
||||
return ResponseEntity(service.createUsersWithListInput(body), HttpStatus.valueOf(200))
|
||||
suspend fun createUsersWithListInput(@Parameter(description = "List of user object", required = true) @Valid @RequestBody user: Flow<User>): ResponseEntity<Unit> {
|
||||
return ResponseEntity(service.createUsersWithListInput(user), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
@Operation(
|
||||
@@ -85,7 +91,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
|
||||
description = """This can only be done by the logged in user.""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "400", description = "Invalid username supplied"),
|
||||
ApiResponse(responseCode = "404", description = "User not found") ]
|
||||
ApiResponse(responseCode = "404", description = "User not found") ],
|
||||
security = [ SecurityRequirement(name = "api_key") ]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.DELETE],
|
||||
@@ -126,7 +133,7 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
|
||||
value = ["/user/login"],
|
||||
produces = ["application/xml", "application/json"]
|
||||
)
|
||||
suspend fun loginUser(@NotNull @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
suspend fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(description = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String,@NotNull @Parameter(description = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String): ResponseEntity<kotlin.String> {
|
||||
return ResponseEntity(service.loginUser(username, password), HttpStatus.valueOf(200))
|
||||
}
|
||||
|
||||
@@ -135,7 +142,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
|
||||
operationId = "logoutUser",
|
||||
description = """""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "200", description = "successful operation") ]
|
||||
ApiResponse(responseCode = "200", description = "successful operation") ],
|
||||
security = [ SecurityRequirement(name = "api_key") ]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.GET],
|
||||
@@ -151,13 +159,15 @@ class UserApiController(@Autowired(required = true) val service: UserApiService)
|
||||
description = """This can only be done by the logged in user.""",
|
||||
responses = [
|
||||
ApiResponse(responseCode = "400", description = "Invalid user supplied"),
|
||||
ApiResponse(responseCode = "404", description = "User not found") ]
|
||||
ApiResponse(responseCode = "404", description = "User not found") ],
|
||||
security = [ SecurityRequirement(name = "api_key") ]
|
||||
)
|
||||
@RequestMapping(
|
||||
method = [RequestMethod.PUT],
|
||||
value = ["/user/{username}"]
|
||||
value = ["/user/{username}"],
|
||||
consumes = ["application/json"]
|
||||
)
|
||||
suspend fun updateUser(@Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") username: kotlin.String,@Parameter(description = "Updated user object", required = true) @Valid @RequestBody body: User): ResponseEntity<Unit> {
|
||||
return ResponseEntity(service.updateUser(username, body), HttpStatus.valueOf(400))
|
||||
suspend fun updateUser(@Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") username: kotlin.String,@Parameter(description = "Updated user object", required = true) @Valid @RequestBody user: User): ResponseEntity<Unit> {
|
||||
return ResponseEntity(service.updateUser(username, user), HttpStatus.valueOf(400))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,29 +9,31 @@ interface UserApiService {
|
||||
* POST /user : Create user
|
||||
* This can only be done by the logged in user.
|
||||
*
|
||||
* @param body Created user object (required)
|
||||
* @param user Created user object (required)
|
||||
* @return successful operation (status code 200)
|
||||
* @see UserApi#createUser
|
||||
*/
|
||||
suspend fun createUser(body: User): Unit
|
||||
suspend fun createUser(user: User): Unit
|
||||
|
||||
/**
|
||||
* POST /user/createWithArray : Creates list of users with given input array
|
||||
*
|
||||
*
|
||||
* @param body List of user object (required)
|
||||
* @param user List of user object (required)
|
||||
* @return successful operation (status code 200)
|
||||
* @see UserApi#createUsersWithArrayInput
|
||||
*/
|
||||
suspend fun createUsersWithArrayInput(body: Flow<User>): Unit
|
||||
suspend fun createUsersWithArrayInput(user: Flow<User>): Unit
|
||||
|
||||
/**
|
||||
* POST /user/createWithList : Creates list of users with given input array
|
||||
*
|
||||
*
|
||||
* @param body List of user object (required)
|
||||
* @param user List of user object (required)
|
||||
* @return successful operation (status code 200)
|
||||
* @see UserApi#createUsersWithListInput
|
||||
*/
|
||||
suspend fun createUsersWithListInput(body: Flow<User>): Unit
|
||||
suspend fun createUsersWithListInput(user: Flow<User>): Unit
|
||||
|
||||
/**
|
||||
* DELETE /user/{username} : Delete user
|
||||
@@ -46,6 +48,7 @@ interface UserApiService {
|
||||
|
||||
/**
|
||||
* GET /user/{username} : Get user by user name
|
||||
*
|
||||
*
|
||||
* @param username The name that needs to be fetched. Use user1 for testing. (required)
|
||||
* @return successful operation (status code 200)
|
||||
@@ -57,6 +60,7 @@ interface UserApiService {
|
||||
|
||||
/**
|
||||
* GET /user/login : Logs user into the system
|
||||
*
|
||||
*
|
||||
* @param username The user name for login (required)
|
||||
* @param password The password for login in clear text (required)
|
||||
@@ -68,6 +72,7 @@ interface UserApiService {
|
||||
|
||||
/**
|
||||
* GET /user/logout : Logs out current logged in user session
|
||||
*
|
||||
*
|
||||
* @return successful operation (status code 200)
|
||||
* @see UserApi#logoutUser
|
||||
@@ -79,10 +84,10 @@ interface UserApiService {
|
||||
* This can only be done by the logged in user.
|
||||
*
|
||||
* @param username name that need to be deleted (required)
|
||||
* @param body Updated user object (required)
|
||||
* @param user Updated user object (required)
|
||||
* @return Invalid user supplied (status code 400)
|
||||
* or User not found (status code 404)
|
||||
* @see UserApi#updateUser
|
||||
*/
|
||||
suspend fun updateUser(username: kotlin.String, body: User): Unit
|
||||
suspend fun updateUser(username: kotlin.String, user: User): Unit
|
||||
}
|
||||
|
||||
@@ -6,15 +6,15 @@ import org.springframework.stereotype.Service
|
||||
@Service
|
||||
class UserApiServiceImpl : UserApiService {
|
||||
|
||||
override suspend fun createUser(body: User): Unit {
|
||||
override suspend fun createUser(user: User): Unit {
|
||||
TODO("Implement me")
|
||||
}
|
||||
|
||||
override suspend fun createUsersWithArrayInput(body: Flow<User>): Unit {
|
||||
override suspend fun createUsersWithArrayInput(user: Flow<User>): Unit {
|
||||
TODO("Implement me")
|
||||
}
|
||||
|
||||
override suspend fun createUsersWithListInput(body: Flow<User>): Unit {
|
||||
override suspend fun createUsersWithListInput(user: Flow<User>): Unit {
|
||||
TODO("Implement me")
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ class UserApiServiceImpl : UserApiService {
|
||||
TODO("Implement me")
|
||||
}
|
||||
|
||||
override suspend fun updateUser(username: kotlin.String, body: User): Unit {
|
||||
override suspend fun updateUser(username: kotlin.String, user: User): Unit {
|
||||
TODO("Implement me")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ data class Category(
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("id") val id: kotlin.Long? = null,
|
||||
|
||||
@get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")
|
||||
@Schema(example = "null", description = "")
|
||||
@get:JsonProperty("name") val name: kotlin.String? = null
|
||||
) {
|
||||
|
||||
@@ -46,6 +46,7 @@ data class Pet(
|
||||
@get:JsonProperty("tags") val tags: kotlin.collections.List<Tag>? = null,
|
||||
|
||||
@Schema(example = "null", description = "pet status in the store")
|
||||
@Deprecated(message = "")
|
||||
@get:JsonProperty("status") val status: Pet.Status? = null
|
||||
) {
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openapi: 3.0.1
|
||||
openapi: 3.0.0
|
||||
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."
|
||||
@@ -7,6 +7,9 @@ info:
|
||||
url: https://www.apache.org/licenses/LICENSE-2.0.html
|
||||
title: OpenAPI Petstore
|
||||
version: 1.0.0
|
||||
externalDocs:
|
||||
description: Find out more about Swagger
|
||||
url: http://swagger.io
|
||||
servers:
|
||||
- url: http://petstore.swagger.io/v2
|
||||
tags:
|
||||
@@ -19,20 +22,21 @@ tags:
|
||||
paths:
|
||||
/pet:
|
||||
post:
|
||||
description: ""
|
||||
operationId: addPet
|
||||
requestBody:
|
||||
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
|
||||
$ref: '#/components/requestBodies/Pet'
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/xml:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
description: successful operation
|
||||
"405":
|
||||
content: {}
|
||||
description: Invalid input
|
||||
security:
|
||||
- petstore_auth:
|
||||
@@ -41,28 +45,29 @@ paths:
|
||||
summary: Add a new pet to the store
|
||||
tags:
|
||||
- pet
|
||||
x-codegen-request-body-name: body
|
||||
put:
|
||||
description: ""
|
||||
externalDocs:
|
||||
description: API documentation for the updatePet operation
|
||||
url: http://petstore.swagger.io/v2/doc/updatePet
|
||||
operationId: updatePet
|
||||
requestBody:
|
||||
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
|
||||
$ref: '#/components/requestBodies/Pet'
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
application/xml:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
description: successful operation
|
||||
"400":
|
||||
content: {}
|
||||
description: Invalid ID supplied
|
||||
"404":
|
||||
content: {}
|
||||
description: Pet not found
|
||||
"405":
|
||||
content: {}
|
||||
description: Validation exception
|
||||
security:
|
||||
- petstore_auth:
|
||||
@@ -71,13 +76,13 @@ paths:
|
||||
summary: Update an existing pet
|
||||
tags:
|
||||
- pet
|
||||
x-codegen-request-body-name: body
|
||||
/pet/findByStatus:
|
||||
get:
|
||||
description: Multiple status values can be provided with comma separated strings
|
||||
operationId: findPetsByStatus
|
||||
parameters:
|
||||
- description: Status values that need to be considered for filter
|
||||
- deprecated: true
|
||||
description: Status values that need to be considered for filter
|
||||
explode: false
|
||||
in: query
|
||||
name: status
|
||||
@@ -107,11 +112,9 @@ paths:
|
||||
type: array
|
||||
description: successful operation
|
||||
"400":
|
||||
content: {}
|
||||
description: Invalid status value
|
||||
security:
|
||||
- petstore_auth:
|
||||
- write:pets
|
||||
- read:pets
|
||||
summary: Finds Pets by status
|
||||
tags:
|
||||
@@ -148,33 +151,36 @@ paths:
|
||||
type: array
|
||||
description: successful operation
|
||||
"400":
|
||||
content: {}
|
||||
description: Invalid tag value
|
||||
security:
|
||||
- petstore_auth:
|
||||
- write:pets
|
||||
- read:pets
|
||||
summary: Finds Pets by tags
|
||||
tags:
|
||||
- pet
|
||||
/pet/{petId}:
|
||||
delete:
|
||||
description: ""
|
||||
operationId: deletePet
|
||||
parameters:
|
||||
- in: header
|
||||
- explode: false
|
||||
in: header
|
||||
name: api_key
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
style: simple
|
||||
- description: Pet id to delete
|
||||
explode: false
|
||||
in: path
|
||||
name: petId
|
||||
required: true
|
||||
schema:
|
||||
format: int64
|
||||
type: integer
|
||||
style: simple
|
||||
responses:
|
||||
"400":
|
||||
content: {}
|
||||
description: Invalid pet value
|
||||
security:
|
||||
- petstore_auth:
|
||||
@@ -188,12 +194,14 @@ paths:
|
||||
operationId: getPetById
|
||||
parameters:
|
||||
- description: ID of pet to return
|
||||
explode: false
|
||||
in: path
|
||||
name: petId
|
||||
required: true
|
||||
schema:
|
||||
format: int64
|
||||
type: integer
|
||||
style: simple
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
@@ -205,10 +213,8 @@ paths:
|
||||
$ref: '#/components/schemas/Pet'
|
||||
description: successful operation
|
||||
"400":
|
||||
content: {}
|
||||
description: Invalid ID supplied
|
||||
"404":
|
||||
content: {}
|
||||
description: Pet not found
|
||||
security:
|
||||
- api_key: []
|
||||
@@ -216,15 +222,18 @@ paths:
|
||||
tags:
|
||||
- pet
|
||||
post:
|
||||
description: ""
|
||||
operationId: updatePetWithForm
|
||||
parameters:
|
||||
- description: ID of pet that needs to be updated
|
||||
explode: false
|
||||
in: path
|
||||
name: petId
|
||||
required: true
|
||||
schema:
|
||||
format: int64
|
||||
type: integer
|
||||
style: simple
|
||||
requestBody:
|
||||
content:
|
||||
application/x-www-form-urlencoded:
|
||||
@@ -232,7 +241,6 @@ paths:
|
||||
$ref: '#/components/schemas/updatePetWithForm_request'
|
||||
responses:
|
||||
"405":
|
||||
content: {}
|
||||
description: Invalid input
|
||||
security:
|
||||
- petstore_auth:
|
||||
@@ -243,15 +251,18 @@ paths:
|
||||
- pet
|
||||
/pet/{petId}/uploadImage:
|
||||
post:
|
||||
description: ""
|
||||
operationId: uploadFile
|
||||
parameters:
|
||||
- description: ID of pet to update
|
||||
explode: false
|
||||
in: path
|
||||
name: petId
|
||||
required: true
|
||||
schema:
|
||||
format: int64
|
||||
type: integer
|
||||
style: simple
|
||||
requestBody:
|
||||
content:
|
||||
multipart/form-data:
|
||||
@@ -292,10 +303,11 @@ paths:
|
||||
- store
|
||||
/store/order:
|
||||
post:
|
||||
description: ""
|
||||
operationId: placeOrder
|
||||
requestBody:
|
||||
content:
|
||||
'*/*':
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Order'
|
||||
description: order placed for purchasing the pet
|
||||
@@ -311,12 +323,10 @@ paths:
|
||||
$ref: '#/components/schemas/Order'
|
||||
description: successful operation
|
||||
"400":
|
||||
content: {}
|
||||
description: Invalid Order
|
||||
summary: Place an order for a pet
|
||||
tags:
|
||||
- store
|
||||
x-codegen-request-body-name: body
|
||||
/store/order/{orderId}:
|
||||
delete:
|
||||
description: For valid response try integer IDs with value < 1000. Anything
|
||||
@@ -324,17 +334,17 @@ paths:
|
||||
operationId: deleteOrder
|
||||
parameters:
|
||||
- description: ID of the order that needs to be deleted
|
||||
explode: false
|
||||
in: path
|
||||
name: orderId
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
style: simple
|
||||
responses:
|
||||
"400":
|
||||
content: {}
|
||||
description: Invalid ID supplied
|
||||
"404":
|
||||
content: {}
|
||||
description: Order not found
|
||||
summary: Delete purchase order by ID
|
||||
tags:
|
||||
@@ -345,6 +355,7 @@ paths:
|
||||
operationId: getOrderById
|
||||
parameters:
|
||||
- description: ID of pet that needs to be fetched
|
||||
explode: false
|
||||
in: path
|
||||
name: orderId
|
||||
required: true
|
||||
@@ -353,6 +364,7 @@ paths:
|
||||
maximum: 5
|
||||
minimum: 1
|
||||
type: integer
|
||||
style: simple
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
@@ -364,10 +376,8 @@ paths:
|
||||
$ref: '#/components/schemas/Order'
|
||||
description: successful operation
|
||||
"400":
|
||||
content: {}
|
||||
description: Invalid ID supplied
|
||||
"404":
|
||||
content: {}
|
||||
description: Order not found
|
||||
summary: Find purchase order by ID
|
||||
tags:
|
||||
@@ -378,75 +388,69 @@ paths:
|
||||
operationId: createUser
|
||||
requestBody:
|
||||
content:
|
||||
'*/*':
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/User'
|
||||
description: Created user object
|
||||
required: true
|
||||
responses:
|
||||
default:
|
||||
content: {}
|
||||
description: successful operation
|
||||
security:
|
||||
- api_key: []
|
||||
summary: Create user
|
||||
tags:
|
||||
- user
|
||||
x-codegen-request-body-name: body
|
||||
/user/createWithArray:
|
||||
post:
|
||||
description: ""
|
||||
operationId: createUsersWithArrayInput
|
||||
requestBody:
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/components/schemas/User'
|
||||
type: array
|
||||
description: List of user object
|
||||
required: true
|
||||
$ref: '#/components/requestBodies/UserArray'
|
||||
responses:
|
||||
default:
|
||||
content: {}
|
||||
description: successful operation
|
||||
security:
|
||||
- api_key: []
|
||||
summary: Creates list of users with given input array
|
||||
tags:
|
||||
- user
|
||||
x-codegen-request-body-name: body
|
||||
/user/createWithList:
|
||||
post:
|
||||
description: ""
|
||||
operationId: createUsersWithListInput
|
||||
requestBody:
|
||||
content:
|
||||
'*/*':
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/components/schemas/User'
|
||||
type: array
|
||||
description: List of user object
|
||||
required: true
|
||||
$ref: '#/components/requestBodies/UserArray'
|
||||
responses:
|
||||
default:
|
||||
content: {}
|
||||
description: successful operation
|
||||
security:
|
||||
- api_key: []
|
||||
summary: Creates list of users with given input array
|
||||
tags:
|
||||
- user
|
||||
x-codegen-request-body-name: body
|
||||
/user/login:
|
||||
get:
|
||||
description: ""
|
||||
operationId: loginUser
|
||||
parameters:
|
||||
- description: The user name for login
|
||||
explode: true
|
||||
in: query
|
||||
name: username
|
||||
required: true
|
||||
schema:
|
||||
pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$"
|
||||
type: string
|
||||
style: form
|
||||
- description: The password for login in clear text
|
||||
explode: true
|
||||
in: query
|
||||
name: password
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
style: form
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
@@ -458,29 +462,42 @@ paths:
|
||||
type: string
|
||||
description: successful operation
|
||||
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:
|
||||
description: calls per hour allowed by the user
|
||||
explode: false
|
||||
schema:
|
||||
format: int32
|
||||
type: integer
|
||||
style: simple
|
||||
X-Expires-After:
|
||||
description: date in UTC when token expires
|
||||
explode: false
|
||||
schema:
|
||||
format: date-time
|
||||
type: string
|
||||
style: simple
|
||||
"400":
|
||||
content: {}
|
||||
description: Invalid username/password supplied
|
||||
summary: Logs user into the system
|
||||
tags:
|
||||
- user
|
||||
/user/logout:
|
||||
get:
|
||||
description: ""
|
||||
operationId: logoutUser
|
||||
responses:
|
||||
default:
|
||||
content: {}
|
||||
description: successful operation
|
||||
security:
|
||||
- api_key: []
|
||||
summary: Logs out current logged in user session
|
||||
tags:
|
||||
- user
|
||||
@@ -490,30 +507,35 @@ paths:
|
||||
operationId: deleteUser
|
||||
parameters:
|
||||
- description: The name that needs to be deleted
|
||||
explode: false
|
||||
in: path
|
||||
name: username
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
style: simple
|
||||
responses:
|
||||
"400":
|
||||
content: {}
|
||||
description: Invalid username supplied
|
||||
"404":
|
||||
content: {}
|
||||
description: User not found
|
||||
security:
|
||||
- api_key: []
|
||||
summary: Delete user
|
||||
tags:
|
||||
- user
|
||||
get:
|
||||
description: ""
|
||||
operationId: getUserByName
|
||||
parameters:
|
||||
- description: The name that needs to be fetched. Use user1 for testing.
|
||||
explode: false
|
||||
in: path
|
||||
name: username
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
style: simple
|
||||
responses:
|
||||
"200":
|
||||
content:
|
||||
@@ -525,10 +547,8 @@ paths:
|
||||
$ref: '#/components/schemas/User'
|
||||
description: successful operation
|
||||
"400":
|
||||
content: {}
|
||||
description: Invalid username supplied
|
||||
"404":
|
||||
content: {}
|
||||
description: User not found
|
||||
summary: Get user by user name
|
||||
tags:
|
||||
@@ -538,30 +558,51 @@ paths:
|
||||
operationId: updateUser
|
||||
parameters:
|
||||
- description: name that need to be deleted
|
||||
explode: false
|
||||
in: path
|
||||
name: username
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
style: simple
|
||||
requestBody:
|
||||
content:
|
||||
'*/*':
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/User'
|
||||
description: Updated user object
|
||||
required: true
|
||||
responses:
|
||||
"400":
|
||||
content: {}
|
||||
description: Invalid user supplied
|
||||
"404":
|
||||
content: {}
|
||||
description: User not found
|
||||
security:
|
||||
- api_key: []
|
||||
summary: Updated user
|
||||
tags:
|
||||
- user
|
||||
x-codegen-request-body-name: body
|
||||
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:
|
||||
Order:
|
||||
description: An order for a pets from the pet store
|
||||
@@ -609,6 +650,7 @@ components:
|
||||
format: int64
|
||||
type: integer
|
||||
name:
|
||||
pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$"
|
||||
type: string
|
||||
title: Pet category
|
||||
type: object
|
||||
@@ -705,6 +747,7 @@ components:
|
||||
name: tag
|
||||
wrapped: true
|
||||
status:
|
||||
deprecated: true
|
||||
description: pet status in the store
|
||||
enum:
|
||||
- available
|
||||
@@ -766,4 +809,3 @@ components:
|
||||
in: header
|
||||
name: api_key
|
||||
type: apiKey
|
||||
x-original-swagger-version: "2.0"
|
||||
|
||||
Reference in New Issue
Block a user