OpenAPITools / OpenAPITools/openapi-generator
[BUG] [JAVA] Description Many configOptions do not work with version openapi-generator-maven-plugin 7.12.0
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Hello
I have a project with maven and spring boot 3.3.2 and java 17.
I want to use openapi-generator-maven-plugin version 7.12.0 to generate java code from OpenApi specification ( yaml file ).
My plugin looks like this in pom.xml.
<!-- generate java code from OpenApi document --> <plugin> <groupId>org.openapitools</groupId> <artifactId>openapi-generator-maven-plugin</artifactId> <version>7.11.0</version> <executions> <execution> <goals> <goal>generate</goal> </goals> <configuration> <inputSpec> ${project.basedir}/src/main/resources/openapi/modelOpenApiV1.yaml </inputSpec> <generatorName>spring</generatorName> <apiPackage>com.astro.attempt</apiPackage> <modelPackage>com.astro.attempt.model</modelPackage> <skipValidateSpec>false</skipValidateSpec> <output>${project.build.directory}/generated-sources/openapi</output> <configOptions> <!-- Set the name for the generated interface not working ??? --> <modelNamePrefix>AlinTemplate</modelNamePrefix> <modelNameSuffix>ApiV1</modelNameSuffix> <useSpringBoot3>true</useSpringBoot3> <interfaceOnly>true</interfaceOnly> <delegatePattern>false</delegatePattern> <generateAliasAsModel>true</generateAliasAsModel> <reactive>false</reactive> <useTags>false</useTags> <useJakartaEe>true</useJakartaEe> </configOptions> </configuration> </execution> </executions> </plugin>
I have OpenApi file version '3.0.4' and it is valid.
I checked it in IntelliJ or with swagger-edditor.
I noticed some configOptions do not works.
For example
I tried to set name for generated inteface with
It is not workin with interfaceNamePrefix and interfaceNameSuffix !
It is not workin with modelNamePrefix and modelNameSuffix.
In OpenApi doc I have
ResponseDetails: title: 'Response details' additionalProperties: type: string description: 'key-string value-string pairs' example: optInId: 'blabla' redirectUrl: 'blabla'
I noticed that java code for ResponseDetails is not generated.
I got message
[INFO] Model ResponseDetails not generated since it's an alias to map (without property) and generateAliasAsModel is set to false (default)
The plugin generate some java code but want do apply some custom setting
( but no special settings).
Maybe some are obsoleted.
Is this plugin able to generate java code with my configuration ?
Is something wrong with my configuration ?
Thank you in advance.
Best regards,
Alin
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the report from pom.xml using the openapi-generator-maven-plugin and src/main/resources/openapi/modelOpenApiV1.yaml. First reconcile the reported 7.12.0 version with the snippet's 7.11.0, then inspect the Spring generator's handling of the listed configOptions and the generated Java output. Done means the documented naming options and generateAliasAsModel behavior match the requested configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100