mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-10-13 16:03:43 +00:00
Co-authored-by: Thomas Sickinger <thomas.sickinger@teamviewer.com>
This commit is contained in:
parent
81cdc82af7
commit
49cadfec3a
@ -232,15 +232,6 @@ public class PythonFastAPIServerCodegen extends AbstractPythonCodegen {
|
||||
if (operations != null) {
|
||||
List<CodegenOperation> ops = operations.getOperation();
|
||||
for (final CodegenOperation operation : ops) {
|
||||
List<CodegenResponse> responses = operation.responses;
|
||||
if (responses != null) {
|
||||
for (final CodegenResponse resp : responses) {
|
||||
// Convert "default" value (0) to OK (200).
|
||||
if ("0".equals(resp.code)) {
|
||||
resp.code = "200";
|
||||
}
|
||||
}
|
||||
}
|
||||
List<CodegenSecurity> securityMethods = operation.authMethods;
|
||||
if (securityMethods != null) {
|
||||
for (final CodegenSecurity securityMethod : securityMethods) {
|
||||
|
@ -41,7 +41,7 @@ for _, name, _ in pkgutil.iter_modules(ns_pkg.__path__, ns_pkg.__name__ + "."):
|
||||
"{{{path}}}",
|
||||
responses={
|
||||
{{#responses}}
|
||||
{{code}}: {{=<% %>=}}{<%#dataType%>"model": <%dataType%>, "description": "<%message%>"<%/dataType%><%^dataType%>"description": "<%message%>"<%/dataType%>}<%={{ }}=%>,
|
||||
{{#isDefault}}"default"{{/isDefault}}{{^isDefault}}{{code}}{{/isDefault}}: {{=<% %>=}}{<%#dataType%>"model": <%dataType%>, "description": "<%message%>"<%/dataType%><%^dataType%>"description": "<%message%>"<%/dataType%>}<%={{ }}=%>,
|
||||
{{/responses}}
|
||||
},
|
||||
tags=[{{#tags}}"{{name}}"{{^-last}},{{/-last}}{{/tags}}],
|
||||
|
@ -39,7 +39,7 @@ for _, name, _ in pkgutil.iter_modules(ns_pkg.__path__, ns_pkg.__name__ + "."):
|
||||
@router.post(
|
||||
"/user",
|
||||
responses={
|
||||
200: {"description": "successful operation"},
|
||||
"default": {"description": "successful operation"},
|
||||
},
|
||||
tags=["user"],
|
||||
summary="Create user",
|
||||
@ -60,7 +60,7 @@ async def create_user(
|
||||
@router.post(
|
||||
"/user/createWithArray",
|
||||
responses={
|
||||
200: {"description": "successful operation"},
|
||||
"default": {"description": "successful operation"},
|
||||
},
|
||||
tags=["user"],
|
||||
summary="Creates list of users with given input array",
|
||||
@ -81,7 +81,7 @@ async def create_users_with_array_input(
|
||||
@router.post(
|
||||
"/user/createWithList",
|
||||
responses={
|
||||
200: {"description": "successful operation"},
|
||||
"default": {"description": "successful operation"},
|
||||
},
|
||||
tags=["user"],
|
||||
summary="Creates list of users with given input array",
|
||||
@ -164,7 +164,7 @@ async def login_user(
|
||||
@router.get(
|
||||
"/user/logout",
|
||||
responses={
|
||||
200: {"description": "successful operation"},
|
||||
"default": {"description": "successful operation"},
|
||||
},
|
||||
tags=["user"],
|
||||
summary="Logs out current logged in user session",
|
||||
|
Loading…
x
Reference in New Issue
Block a user