From 1b49c4d9734fd0a1348700a31318309dab553f30 Mon Sep 17 00:00:00 2001 From: frantuma Date: Wed, 18 Dec 2024 07:22:03 +0100 Subject: [PATCH] fix Decimal processing in CSharp --- pom.xml | 2 +- .../swagger/codegen/v3/generators/DefaultCodegenConfig.java | 4 ++-- .../codegen/v3/generators/dotnet/AbstractCSharpCodegen.java | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 2b07fed064..ea792d2ceb 100644 --- a/pom.xml +++ b/pom.xml @@ -262,7 +262,7 @@ 8 - 3.0.64 + 3.0.65-SNAPSHOT 2.1.22 2.2.25 2.17.2 diff --git a/src/main/java/io/swagger/codegen/v3/generators/DefaultCodegenConfig.java b/src/main/java/io/swagger/codegen/v3/generators/DefaultCodegenConfig.java index d3bc1a0153..b8eaa280b2 100644 --- a/src/main/java/io/swagger/codegen/v3/generators/DefaultCodegenConfig.java +++ b/src/main/java/io/swagger/codegen/v3/generators/DefaultCodegenConfig.java @@ -2168,7 +2168,7 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation if (schema == null) { CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); - codegenParameter.description = body.getDescription(); + codegenParameter.description = escapeText(body.getDescription()); codegenParameter.unescapedDescription = body.getDescription(); String bodyName = REQUEST_BODY_NAME; if (body.getExtensions() != null && body.getExtensions().get("x-codegen-request-body-name") != null) { @@ -2679,7 +2679,7 @@ public CodegenParameter fromRequestBody(RequestBody body, String name, Schema sc } codegenParameter.baseName = bodyName; codegenParameter.paramName = bodyName; - codegenParameter.description = body.getDescription(); + codegenParameter.description = escapeText(body.getDescription()); codegenParameter.unescapedDescription = body.getDescription(); codegenParameter.required = body.getRequired() != null ? body.getRequired() : Boolean.FALSE; codegenParameter.getVendorExtensions().put(CodegenConstants.IS_BODY_PARAM_EXT_NAME, Boolean.TRUE); diff --git a/src/main/java/io/swagger/codegen/v3/generators/dotnet/AbstractCSharpCodegen.java b/src/main/java/io/swagger/codegen/v3/generators/dotnet/AbstractCSharpCodegen.java index 4af6b28480..4e6e39e446 100644 --- a/src/main/java/io/swagger/codegen/v3/generators/dotnet/AbstractCSharpCodegen.java +++ b/src/main/java/io/swagger/codegen/v3/generators/dotnet/AbstractCSharpCodegen.java @@ -152,6 +152,8 @@ public AbstractCSharpCodegen() { "String", "Boolean", "Double", + "Decimal", + "BigDecimal", "Int32", "Int64", "Float",