From 088fb2b753752661ae450927760676f8103e065c Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 9 Dec 2025 14:12:32 +0800 Subject: [PATCH 1/2] python-fastapi: avoid log message in constructor --- .../codegen/languages/PythonFastAPIServerCodegen.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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)); } From a7ecbca8a79d7848dc20fd1f47237e728fd0d992 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 9 Dec 2025 14:36:05 +0800 Subject: [PATCH 2/2] update doc --- docs/generators.md | 1 - 1 file changed, 1 deletion(-) 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