forked from loafle/openapi-generator-original
Merge pull request #4188 from cbornet/flask_operations
[Flask] Use x-swagger-router-controller in for operation routing
This commit is contained in:
commit
359e52b173
@ -278,52 +278,30 @@ public class FlaskConnexionCodegen extends DefaultCodegen implements CodegenConf
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void preprocessSwagger(Swagger swagger) {
|
public void preprocessSwagger(Swagger swagger) {
|
||||||
if (swagger != null && swagger.getPaths() != null) {
|
// need vendor extensions for x-swagger-router-controller
|
||||||
for(String pathname : swagger.getPaths().keySet()) {
|
Map<String, Path> paths = swagger.getPaths();
|
||||||
Path path = swagger.getPath(pathname);
|
if(paths != null) {
|
||||||
if (path.getOperations() != null) {
|
for(String pathname : paths.keySet()) {
|
||||||
for(Map.Entry<HttpMethod, Operation> entry : path.getOperationMap().entrySet()) {
|
Path path = paths.get(pathname);
|
||||||
// Normalize `operationId` and add package/class path in front, e.g.
|
Map<HttpMethod, Operation> operationMap = path.getOperationMap();
|
||||||
// controllers.default_controller.add_pet
|
if(operationMap != null) {
|
||||||
String httpMethod = entry.getKey().name().toLowerCase();
|
for(HttpMethod method : operationMap.keySet()) {
|
||||||
Operation operation = entry.getValue();
|
Operation operation = operationMap.get(method);
|
||||||
String operationId = getOrGenerateOperationId(operation, pathname, httpMethod);
|
String tag = "default";
|
||||||
String controllerName;
|
if(operation.getTags() != null && operation.getTags().size() > 0) {
|
||||||
|
tag = operation.getTags().get(0);
|
||||||
if (operation.getTags() != null) {
|
|
||||||
List<Map<String, String>> tags = new ArrayList<Map<String, String>>();
|
|
||||||
for(String tag : operation.getTags()) {
|
|
||||||
Map<String, String> value = new HashMap<String, String>();
|
|
||||||
value.put("tag", tag);
|
|
||||||
value.put("hasMore", "true");
|
|
||||||
tags.add(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tags.size() > 0) {
|
|
||||||
tags.get(tags.size() - 1).remove("hasMore");
|
|
||||||
}
|
|
||||||
|
|
||||||
// use only the first tag
|
|
||||||
if (operation.getTags().size() > 0) {
|
|
||||||
String tag = operation.getTags().get(0);
|
|
||||||
operation.setTags(Arrays.asList(tag));
|
|
||||||
controllerName = tag + "_controller";
|
|
||||||
} else {
|
|
||||||
controllerName = "default_controller";
|
|
||||||
}
|
|
||||||
|
|
||||||
operation.setVendorExtension("x-tags", tags);
|
|
||||||
}
|
}
|
||||||
else {
|
String operationId = operation.getOperationId();
|
||||||
// no tag found, use "default_controller" as the default
|
if(operationId == null) {
|
||||||
String tag = "default";
|
operationId = getOrGenerateOperationId(operation, pathname, method.toString());
|
||||||
operation.setTags(Arrays.asList(tag));
|
}
|
||||||
controllerName = tag + "_controller";
|
operation.setOperationId(toOperationId(operationId));
|
||||||
|
if(operation.getVendorExtensions().get("x-swagger-router-controller") == null) {
|
||||||
|
operation.getVendorExtensions().put(
|
||||||
|
"x-swagger-router-controller",
|
||||||
|
controllerPackage + "." + toApiFilename(tag)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
operationId = underscore(sanitizeName(operationId));
|
|
||||||
operationId = controllerPackage + "." + controllerName + "." + operationId;
|
|
||||||
operation.setOperationId(operationId);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ paths:
|
|||||||
- "pet"
|
- "pet"
|
||||||
summary: "Add a new pet to the store"
|
summary: "Add a new pet to the store"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.pet_controller.add_pet"
|
operationId: "add_pet"
|
||||||
consumes:
|
consumes:
|
||||||
- "application/json"
|
- "application/json"
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
@ -58,14 +58,13 @@ paths:
|
|||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write:pets"
|
- "write:pets"
|
||||||
- "read:pets"
|
- "read:pets"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.pet_controller"
|
||||||
- tag: "pet"
|
|
||||||
put:
|
put:
|
||||||
tags:
|
tags:
|
||||||
- "pet"
|
- "pet"
|
||||||
summary: "Update an existing pet"
|
summary: "Update an existing pet"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.pet_controller.update_pet"
|
operationId: "update_pet"
|
||||||
consumes:
|
consumes:
|
||||||
- "application/json"
|
- "application/json"
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
@ -90,15 +89,14 @@ paths:
|
|||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write:pets"
|
- "write:pets"
|
||||||
- "read:pets"
|
- "read:pets"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.pet_controller"
|
||||||
- tag: "pet"
|
|
||||||
/pet/findByStatus:
|
/pet/findByStatus:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- "pet"
|
- "pet"
|
||||||
summary: "Finds Pets by status"
|
summary: "Finds Pets by status"
|
||||||
description: "Multiple status values can be provided with comma separated strings"
|
description: "Multiple status values can be provided with comma separated strings"
|
||||||
operationId: "controllers.pet_controller.find_pets_by_status"
|
operationId: "find_pets_by_status"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -129,8 +127,7 @@ paths:
|
|||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write:pets"
|
- "write:pets"
|
||||||
- "read:pets"
|
- "read:pets"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.pet_controller"
|
||||||
- tag: "pet"
|
|
||||||
/pet/findByTags:
|
/pet/findByTags:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
@ -138,7 +135,7 @@ paths:
|
|||||||
summary: "Finds Pets by tags"
|
summary: "Finds Pets by tags"
|
||||||
description: "Multiple tags can be provided with comma separated strings. Use\
|
description: "Multiple tags can be provided with comma separated strings. Use\
|
||||||
\ tag1, tag2, tag3 for testing."
|
\ tag1, tag2, tag3 for testing."
|
||||||
operationId: "controllers.pet_controller.find_pets_by_tags"
|
operationId: "find_pets_by_tags"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -164,15 +161,14 @@ paths:
|
|||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write:pets"
|
- "write:pets"
|
||||||
- "read:pets"
|
- "read:pets"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.pet_controller"
|
||||||
- tag: "pet"
|
|
||||||
/pet/{petId}:
|
/pet/{petId}:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- "pet"
|
- "pet"
|
||||||
summary: "Find pet by ID"
|
summary: "Find pet by ID"
|
||||||
description: "Returns a single pet"
|
description: "Returns a single pet"
|
||||||
operationId: "controllers.pet_controller.get_pet_by_id"
|
operationId: "get_pet_by_id"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -194,14 +190,13 @@ paths:
|
|||||||
description: "Pet not found"
|
description: "Pet not found"
|
||||||
security:
|
security:
|
||||||
- api_key: []
|
- api_key: []
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.pet_controller"
|
||||||
- tag: "pet"
|
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "pet"
|
- "pet"
|
||||||
summary: "Updates a pet in the store with form data"
|
summary: "Updates a pet in the store with form data"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.pet_controller.update_pet_with_form"
|
operationId: "update_pet_with_form"
|
||||||
consumes:
|
consumes:
|
||||||
- "application/x-www-form-urlencoded"
|
- "application/x-www-form-urlencoded"
|
||||||
produces:
|
produces:
|
||||||
@ -231,14 +226,13 @@ paths:
|
|||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write:pets"
|
- "write:pets"
|
||||||
- "read:pets"
|
- "read:pets"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.pet_controller"
|
||||||
- tag: "pet"
|
|
||||||
delete:
|
delete:
|
||||||
tags:
|
tags:
|
||||||
- "pet"
|
- "pet"
|
||||||
summary: "Deletes a pet"
|
summary: "Deletes a pet"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.pet_controller.delete_pet"
|
operationId: "delete_pet"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -260,15 +254,14 @@ paths:
|
|||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write:pets"
|
- "write:pets"
|
||||||
- "read:pets"
|
- "read:pets"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.pet_controller"
|
||||||
- tag: "pet"
|
|
||||||
/pet/{petId}/uploadImage:
|
/pet/{petId}/uploadImage:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "pet"
|
- "pet"
|
||||||
summary: "uploads an image"
|
summary: "uploads an image"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.pet_controller.upload_file"
|
operationId: "upload_file"
|
||||||
consumes:
|
consumes:
|
||||||
- "multipart/form-data"
|
- "multipart/form-data"
|
||||||
produces:
|
produces:
|
||||||
@ -299,15 +292,14 @@ paths:
|
|||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write:pets"
|
- "write:pets"
|
||||||
- "read:pets"
|
- "read:pets"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.pet_controller"
|
||||||
- tag: "pet"
|
|
||||||
/store/inventory:
|
/store/inventory:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- "store"
|
- "store"
|
||||||
summary: "Returns pet inventories by status"
|
summary: "Returns pet inventories by status"
|
||||||
description: "Returns a map of status codes to quantities"
|
description: "Returns a map of status codes to quantities"
|
||||||
operationId: "controllers.store_controller.get_inventory"
|
operationId: "get_inventory"
|
||||||
produces:
|
produces:
|
||||||
- "application/json"
|
- "application/json"
|
||||||
parameters: []
|
parameters: []
|
||||||
@ -321,15 +313,14 @@ paths:
|
|||||||
format: "int32"
|
format: "int32"
|
||||||
security:
|
security:
|
||||||
- api_key: []
|
- api_key: []
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.store_controller"
|
||||||
- tag: "store"
|
|
||||||
/store/order:
|
/store/order:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "store"
|
- "store"
|
||||||
summary: "Place an order for a pet"
|
summary: "Place an order for a pet"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.store_controller.place_order"
|
operationId: "place_order"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -347,8 +338,7 @@ paths:
|
|||||||
$ref: "#/definitions/Order"
|
$ref: "#/definitions/Order"
|
||||||
400:
|
400:
|
||||||
description: "Invalid Order"
|
description: "Invalid Order"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.store_controller"
|
||||||
- tag: "store"
|
|
||||||
/store/order/{orderId}:
|
/store/order/{orderId}:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
@ -356,7 +346,7 @@ paths:
|
|||||||
summary: "Find purchase order by ID"
|
summary: "Find purchase order by ID"
|
||||||
description: "For valid response try integer IDs with value <= 5 or > 10. Other\
|
description: "For valid response try integer IDs with value <= 5 or > 10. Other\
|
||||||
\ values will generated exceptions"
|
\ values will generated exceptions"
|
||||||
operationId: "controllers.store_controller.get_order_by_id"
|
operationId: "get_order_by_id"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -378,15 +368,14 @@ paths:
|
|||||||
description: "Invalid ID supplied"
|
description: "Invalid ID supplied"
|
||||||
404:
|
404:
|
||||||
description: "Order not found"
|
description: "Order not found"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.store_controller"
|
||||||
- tag: "store"
|
|
||||||
delete:
|
delete:
|
||||||
tags:
|
tags:
|
||||||
- "store"
|
- "store"
|
||||||
summary: "Delete purchase order by ID"
|
summary: "Delete purchase order by ID"
|
||||||
description: "For valid response try integer IDs with value < 1000. Anything\
|
description: "For valid response try integer IDs with value < 1000. Anything\
|
||||||
\ above 1000 or nonintegers will generate API errors"
|
\ above 1000 or nonintegers will generate API errors"
|
||||||
operationId: "controllers.store_controller.delete_order"
|
operationId: "delete_order"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -402,15 +391,14 @@ paths:
|
|||||||
description: "Invalid ID supplied"
|
description: "Invalid ID supplied"
|
||||||
404:
|
404:
|
||||||
description: "Order not found"
|
description: "Order not found"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.store_controller"
|
||||||
- tag: "store"
|
|
||||||
/user:
|
/user:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
summary: "Create user"
|
summary: "Create user"
|
||||||
description: "This can only be done by the logged in user."
|
description: "This can only be done by the logged in user."
|
||||||
operationId: "controllers.user_controller.create_user"
|
operationId: "create_user"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -424,15 +412,14 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.user_controller"
|
||||||
- tag: "user"
|
|
||||||
/user/createWithArray:
|
/user/createWithArray:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
summary: "Creates list of users with given input array"
|
summary: "Creates list of users with given input array"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.user_controller.create_users_with_array_input"
|
operationId: "create_users_with_array_input"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -448,15 +435,14 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.user_controller"
|
||||||
- tag: "user"
|
|
||||||
/user/createWithList:
|
/user/createWithList:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
summary: "Creates list of users with given input array"
|
summary: "Creates list of users with given input array"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.user_controller.create_users_with_list_input"
|
operationId: "create_users_with_list_input"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -472,15 +458,14 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.user_controller"
|
||||||
- tag: "user"
|
|
||||||
/user/login:
|
/user/login:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
summary: "Logs user into the system"
|
summary: "Logs user into the system"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.user_controller.login_user"
|
operationId: "login_user"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -511,15 +496,14 @@ paths:
|
|||||||
description: "date in UTC when toekn expires"
|
description: "date in UTC when toekn expires"
|
||||||
400:
|
400:
|
||||||
description: "Invalid username/password supplied"
|
description: "Invalid username/password supplied"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.user_controller"
|
||||||
- tag: "user"
|
|
||||||
/user/logout:
|
/user/logout:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
summary: "Logs out current logged in user session"
|
summary: "Logs out current logged in user session"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.user_controller.logout_user"
|
operationId: "logout_user"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -527,15 +511,14 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.user_controller"
|
||||||
- tag: "user"
|
|
||||||
/user/{username}:
|
/user/{username}:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
summary: "Get user by user name"
|
summary: "Get user by user name"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.user_controller.get_user_by_name"
|
operationId: "get_user_by_name"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -554,14 +537,13 @@ paths:
|
|||||||
description: "Invalid username supplied"
|
description: "Invalid username supplied"
|
||||||
404:
|
404:
|
||||||
description: "User not found"
|
description: "User not found"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.user_controller"
|
||||||
- tag: "user"
|
|
||||||
put:
|
put:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
summary: "Updated user"
|
summary: "Updated user"
|
||||||
description: "This can only be done by the logged in user."
|
description: "This can only be done by the logged in user."
|
||||||
operationId: "controllers.user_controller.update_user"
|
operationId: "update_user"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -582,14 +564,13 @@ paths:
|
|||||||
description: "Invalid user supplied"
|
description: "Invalid user supplied"
|
||||||
404:
|
404:
|
||||||
description: "User not found"
|
description: "User not found"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.user_controller"
|
||||||
- tag: "user"
|
|
||||||
delete:
|
delete:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
summary: "Delete user"
|
summary: "Delete user"
|
||||||
description: "This can only be done by the logged in user."
|
description: "This can only be done by the logged in user."
|
||||||
operationId: "controllers.user_controller.delete_user"
|
operationId: "delete_user"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -604,8 +585,7 @@ paths:
|
|||||||
description: "Invalid username supplied"
|
description: "Invalid username supplied"
|
||||||
404:
|
404:
|
||||||
description: "User not found"
|
description: "User not found"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.user_controller"
|
||||||
- tag: "user"
|
|
||||||
securityDefinitions:
|
securityDefinitions:
|
||||||
petstore_auth:
|
petstore_auth:
|
||||||
type: "oauth2"
|
type: "oauth2"
|
||||||
|
@ -37,7 +37,7 @@ paths:
|
|||||||
- "pet"
|
- "pet"
|
||||||
summary: "Add a new pet to the store"
|
summary: "Add a new pet to the store"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.pet_controller.add_pet"
|
operationId: "add_pet"
|
||||||
consumes:
|
consumes:
|
||||||
- "application/json"
|
- "application/json"
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
@ -58,14 +58,13 @@ paths:
|
|||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write:pets"
|
- "write:pets"
|
||||||
- "read:pets"
|
- "read:pets"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.pet_controller"
|
||||||
- tag: "pet"
|
|
||||||
put:
|
put:
|
||||||
tags:
|
tags:
|
||||||
- "pet"
|
- "pet"
|
||||||
summary: "Update an existing pet"
|
summary: "Update an existing pet"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.pet_controller.update_pet"
|
operationId: "update_pet"
|
||||||
consumes:
|
consumes:
|
||||||
- "application/json"
|
- "application/json"
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
@ -90,15 +89,14 @@ paths:
|
|||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write:pets"
|
- "write:pets"
|
||||||
- "read:pets"
|
- "read:pets"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.pet_controller"
|
||||||
- tag: "pet"
|
|
||||||
/pet/findByStatus:
|
/pet/findByStatus:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- "pet"
|
- "pet"
|
||||||
summary: "Finds Pets by status"
|
summary: "Finds Pets by status"
|
||||||
description: "Multiple status values can be provided with comma separated strings"
|
description: "Multiple status values can be provided with comma separated strings"
|
||||||
operationId: "controllers.pet_controller.find_pets_by_status"
|
operationId: "find_pets_by_status"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -129,8 +127,7 @@ paths:
|
|||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write:pets"
|
- "write:pets"
|
||||||
- "read:pets"
|
- "read:pets"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.pet_controller"
|
||||||
- tag: "pet"
|
|
||||||
/pet/findByTags:
|
/pet/findByTags:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
@ -138,7 +135,7 @@ paths:
|
|||||||
summary: "Finds Pets by tags"
|
summary: "Finds Pets by tags"
|
||||||
description: "Multiple tags can be provided with comma separated strings. Use\
|
description: "Multiple tags can be provided with comma separated strings. Use\
|
||||||
\ tag1, tag2, tag3 for testing."
|
\ tag1, tag2, tag3 for testing."
|
||||||
operationId: "controllers.pet_controller.find_pets_by_tags"
|
operationId: "find_pets_by_tags"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -164,15 +161,14 @@ paths:
|
|||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write:pets"
|
- "write:pets"
|
||||||
- "read:pets"
|
- "read:pets"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.pet_controller"
|
||||||
- tag: "pet"
|
|
||||||
/pet/{petId}:
|
/pet/{petId}:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- "pet"
|
- "pet"
|
||||||
summary: "Find pet by ID"
|
summary: "Find pet by ID"
|
||||||
description: "Returns a single pet"
|
description: "Returns a single pet"
|
||||||
operationId: "controllers.pet_controller.get_pet_by_id"
|
operationId: "get_pet_by_id"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -194,14 +190,13 @@ paths:
|
|||||||
description: "Pet not found"
|
description: "Pet not found"
|
||||||
security:
|
security:
|
||||||
- api_key: []
|
- api_key: []
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.pet_controller"
|
||||||
- tag: "pet"
|
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "pet"
|
- "pet"
|
||||||
summary: "Updates a pet in the store with form data"
|
summary: "Updates a pet in the store with form data"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.pet_controller.update_pet_with_form"
|
operationId: "update_pet_with_form"
|
||||||
consumes:
|
consumes:
|
||||||
- "application/x-www-form-urlencoded"
|
- "application/x-www-form-urlencoded"
|
||||||
produces:
|
produces:
|
||||||
@ -231,14 +226,13 @@ paths:
|
|||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write:pets"
|
- "write:pets"
|
||||||
- "read:pets"
|
- "read:pets"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.pet_controller"
|
||||||
- tag: "pet"
|
|
||||||
delete:
|
delete:
|
||||||
tags:
|
tags:
|
||||||
- "pet"
|
- "pet"
|
||||||
summary: "Deletes a pet"
|
summary: "Deletes a pet"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.pet_controller.delete_pet"
|
operationId: "delete_pet"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -260,15 +254,14 @@ paths:
|
|||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write:pets"
|
- "write:pets"
|
||||||
- "read:pets"
|
- "read:pets"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.pet_controller"
|
||||||
- tag: "pet"
|
|
||||||
/pet/{petId}/uploadImage:
|
/pet/{petId}/uploadImage:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "pet"
|
- "pet"
|
||||||
summary: "uploads an image"
|
summary: "uploads an image"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.pet_controller.upload_file"
|
operationId: "upload_file"
|
||||||
consumes:
|
consumes:
|
||||||
- "multipart/form-data"
|
- "multipart/form-data"
|
||||||
produces:
|
produces:
|
||||||
@ -299,15 +292,14 @@ paths:
|
|||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write:pets"
|
- "write:pets"
|
||||||
- "read:pets"
|
- "read:pets"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.pet_controller"
|
||||||
- tag: "pet"
|
|
||||||
/store/inventory:
|
/store/inventory:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- "store"
|
- "store"
|
||||||
summary: "Returns pet inventories by status"
|
summary: "Returns pet inventories by status"
|
||||||
description: "Returns a map of status codes to quantities"
|
description: "Returns a map of status codes to quantities"
|
||||||
operationId: "controllers.store_controller.get_inventory"
|
operationId: "get_inventory"
|
||||||
produces:
|
produces:
|
||||||
- "application/json"
|
- "application/json"
|
||||||
parameters: []
|
parameters: []
|
||||||
@ -321,15 +313,14 @@ paths:
|
|||||||
format: "int32"
|
format: "int32"
|
||||||
security:
|
security:
|
||||||
- api_key: []
|
- api_key: []
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.store_controller"
|
||||||
- tag: "store"
|
|
||||||
/store/order:
|
/store/order:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "store"
|
- "store"
|
||||||
summary: "Place an order for a pet"
|
summary: "Place an order for a pet"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.store_controller.place_order"
|
operationId: "place_order"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -347,8 +338,7 @@ paths:
|
|||||||
$ref: "#/definitions/Order"
|
$ref: "#/definitions/Order"
|
||||||
400:
|
400:
|
||||||
description: "Invalid Order"
|
description: "Invalid Order"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.store_controller"
|
||||||
- tag: "store"
|
|
||||||
/store/order/{orderId}:
|
/store/order/{orderId}:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
@ -356,7 +346,7 @@ paths:
|
|||||||
summary: "Find purchase order by ID"
|
summary: "Find purchase order by ID"
|
||||||
description: "For valid response try integer IDs with value <= 5 or > 10. Other\
|
description: "For valid response try integer IDs with value <= 5 or > 10. Other\
|
||||||
\ values will generated exceptions"
|
\ values will generated exceptions"
|
||||||
operationId: "controllers.store_controller.get_order_by_id"
|
operationId: "get_order_by_id"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -378,15 +368,14 @@ paths:
|
|||||||
description: "Invalid ID supplied"
|
description: "Invalid ID supplied"
|
||||||
404:
|
404:
|
||||||
description: "Order not found"
|
description: "Order not found"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.store_controller"
|
||||||
- tag: "store"
|
|
||||||
delete:
|
delete:
|
||||||
tags:
|
tags:
|
||||||
- "store"
|
- "store"
|
||||||
summary: "Delete purchase order by ID"
|
summary: "Delete purchase order by ID"
|
||||||
description: "For valid response try integer IDs with value < 1000. Anything\
|
description: "For valid response try integer IDs with value < 1000. Anything\
|
||||||
\ above 1000 or nonintegers will generate API errors"
|
\ above 1000 or nonintegers will generate API errors"
|
||||||
operationId: "controllers.store_controller.delete_order"
|
operationId: "delete_order"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -402,15 +391,14 @@ paths:
|
|||||||
description: "Invalid ID supplied"
|
description: "Invalid ID supplied"
|
||||||
404:
|
404:
|
||||||
description: "Order not found"
|
description: "Order not found"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.store_controller"
|
||||||
- tag: "store"
|
|
||||||
/user:
|
/user:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
summary: "Create user"
|
summary: "Create user"
|
||||||
description: "This can only be done by the logged in user."
|
description: "This can only be done by the logged in user."
|
||||||
operationId: "controllers.user_controller.create_user"
|
operationId: "create_user"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -424,15 +412,14 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.user_controller"
|
||||||
- tag: "user"
|
|
||||||
/user/createWithArray:
|
/user/createWithArray:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
summary: "Creates list of users with given input array"
|
summary: "Creates list of users with given input array"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.user_controller.create_users_with_array_input"
|
operationId: "create_users_with_array_input"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -448,15 +435,14 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.user_controller"
|
||||||
- tag: "user"
|
|
||||||
/user/createWithList:
|
/user/createWithList:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
summary: "Creates list of users with given input array"
|
summary: "Creates list of users with given input array"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.user_controller.create_users_with_list_input"
|
operationId: "create_users_with_list_input"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -472,15 +458,14 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.user_controller"
|
||||||
- tag: "user"
|
|
||||||
/user/login:
|
/user/login:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
summary: "Logs user into the system"
|
summary: "Logs user into the system"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.user_controller.login_user"
|
operationId: "login_user"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -511,15 +496,14 @@ paths:
|
|||||||
description: "date in UTC when toekn expires"
|
description: "date in UTC when toekn expires"
|
||||||
400:
|
400:
|
||||||
description: "Invalid username/password supplied"
|
description: "Invalid username/password supplied"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.user_controller"
|
||||||
- tag: "user"
|
|
||||||
/user/logout:
|
/user/logout:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
summary: "Logs out current logged in user session"
|
summary: "Logs out current logged in user session"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.user_controller.logout_user"
|
operationId: "logout_user"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -527,15 +511,14 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.user_controller"
|
||||||
- tag: "user"
|
|
||||||
/user/{username}:
|
/user/{username}:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
summary: "Get user by user name"
|
summary: "Get user by user name"
|
||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.user_controller.get_user_by_name"
|
operationId: "get_user_by_name"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -554,14 +537,13 @@ paths:
|
|||||||
description: "Invalid username supplied"
|
description: "Invalid username supplied"
|
||||||
404:
|
404:
|
||||||
description: "User not found"
|
description: "User not found"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.user_controller"
|
||||||
- tag: "user"
|
|
||||||
put:
|
put:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
summary: "Updated user"
|
summary: "Updated user"
|
||||||
description: "This can only be done by the logged in user."
|
description: "This can only be done by the logged in user."
|
||||||
operationId: "controllers.user_controller.update_user"
|
operationId: "update_user"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -582,14 +564,13 @@ paths:
|
|||||||
description: "Invalid user supplied"
|
description: "Invalid user supplied"
|
||||||
404:
|
404:
|
||||||
description: "User not found"
|
description: "User not found"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.user_controller"
|
||||||
- tag: "user"
|
|
||||||
delete:
|
delete:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
summary: "Delete user"
|
summary: "Delete user"
|
||||||
description: "This can only be done by the logged in user."
|
description: "This can only be done by the logged in user."
|
||||||
operationId: "controllers.user_controller.delete_user"
|
operationId: "delete_user"
|
||||||
produces:
|
produces:
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
- "application/json"
|
- "application/json"
|
||||||
@ -604,8 +585,7 @@ paths:
|
|||||||
description: "Invalid username supplied"
|
description: "Invalid username supplied"
|
||||||
404:
|
404:
|
||||||
description: "User not found"
|
description: "User not found"
|
||||||
x-tags:
|
x-swagger-router-controller: "controllers.user_controller"
|
||||||
- tag: "user"
|
|
||||||
securityDefinitions:
|
securityDefinitions:
|
||||||
petstore_auth:
|
petstore_auth:
|
||||||
type: "oauth2"
|
type: "oauth2"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user