diff --git a/docs/generators.md b/docs/generators.md index c532ce21b806..8a8ff23086b8 100644 --- a/docs/generators.md +++ b/docs/generators.md @@ -3,7 +3,6 @@ id: generators title: Generators List --- -[main] INFO o.o.c.l.PythonFastAPIServerCodegen - Skipping sorting of path operations, order matters, let the developer decide via their specification file. The following generators are available: ## CLIENT generators diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFastAPIServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFastAPIServerCodegen.java index 15e5534b000e..b8044bd2219f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFastAPIServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonFastAPIServerCodegen.java @@ -90,9 +90,6 @@ public String getHelp() { public PythonFastAPIServerCodegen() { super(); - // Skip sorting of operations to preserve the order found in the OpenAPI spec file. See - // https://fastapi.tiangolo.com/tutorial/path-params/?h=path#order-matters for details on why order matters. - LOGGER.info("Skipping sorting of path operations, order matters, let the developer decide via their specification file."); setSkipSortingOperations(true); modifyFeatureSet(features -> features.includeSecurityFeatures( @@ -150,6 +147,11 @@ public PythonFastAPIServerCodegen() { public void processOpts() { super.processOpts(); + // Skip sorting of operations via setSkipSortingOperations(true) in the constructor to preserve the order + // found in the OpenAPI spec file. See + // https://fastapi.tiangolo.com/tutorial/path-params/?h=path#order-matters for details on why order matters. + LOGGER.info("Skipping sorting of path operations, order matters, let the developer decide via their specification file."); + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); }