mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2026-03-18 17:09:01 +00:00
Fix flask connexion support (#1066)
Use the dev-2.0 git branch of flask connexion to fix the generator. This is not ideal but better than a generator not working at all. Fix #323
This commit is contained in:
committed by
William Cheng
parent
c0a6eaab85
commit
6dc618fa3f
@@ -312,7 +312,8 @@ public class PythonFlaskConnexionServerCodegen extends DefaultCodegen implements
|
||||
|
||||
@Override
|
||||
public void preprocessOpenAPI(OpenAPI openAPI) {
|
||||
// need vendor extensions for x-openapi-router-controller
|
||||
// need vendor extensions for x-swagger-router-controller
|
||||
// can be changed to x-openapi-router-controller when https://github.com/zalando/connexion/issues/683 is done
|
||||
Map<String, PathItem> paths = openAPI.getPaths();
|
||||
if (paths != null) {
|
||||
for (String pathname : paths.keySet()) {
|
||||
@@ -330,9 +331,9 @@ public class PythonFlaskConnexionServerCodegen extends DefaultCodegen implements
|
||||
operationId = getOrGenerateOperationId(operation, pathname, method.toString());
|
||||
}
|
||||
operation.setOperationId(toOperationId(operationId));
|
||||
if (operation.getExtensions() == null || operation.getExtensions().get("x-openapi-router-controller") == null) {
|
||||
if (operation.getExtensions() == null || operation.getExtensions().get("x-swagger-router-controller") == null) {
|
||||
operation.addExtension(
|
||||
"x-openapi-router-controller",
|
||||
"x-swagger-router-controller",
|
||||
controllerPackage + "." + toApiFilename(tag)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user