Skip to content

[BUG] [JAVA] Description Many configOptions do not work with version openapi-generator-maven-plugin 7.12.0 #20984

@aliosasbbv

Description

@aliosasbbv

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions