[BUG][JAVA] additionalModelTypeAnnotations value is escaped
Created by: gdrouet
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
What's the version of OpenAPI Generator used? -
Have you search for related issues/PRs? -
What's the actual output vs expected output? -
[Optional] Bounty to sponsor the fix (example)
Description
The annotations specified with additionalModelTypeAnnotations
are escaped.
Thefore, using a special character like =
leads to a compilation error.
openapi-generator version
4.2.x
OpenAPI declaration file content or url
<!-- activate the plugin -->
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>4.3.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sample-schema</artifactId>
<version>${project.parent.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>openapi.yaml</inputSpec>
<generatorName>java</generatorName>
<configOptions>
<additionalModelTypeAnnotations>@Foo(val=true)</additionalModelTypeAnnotations>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
Command line used for generation
Just run the maven plugin.
Steps to reproduce
Inside additionalModelTypeAnnotations
, add a value with any special character like @Foo(val=true)
.
Compilation will fail becaise the annotation is written like this: @Foo(val=true)
Suggest a fix
Do not escape the value inside the template.