3

I want to generate java model classes from yaml file without annotations in generating classes. How it is possible to generate? I tried multiple ways but not able to generate model classes without annotations. Always containing annotations in generating classes.

<plugins>
            <plugin>
                <groupId>org.openapitools</groupId>
                <artifactId>openapi-generator-maven-plugin</artifactId>
                <version>5.1.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <inputSpec>${project.basedir}/src/main/resources/pesttore.yml</inputSpec>
                            <modelPackage>com.my.path.to.api</modelPackage>
                            <generatorName>java</generatorName>
                            <generateApis>false</generateApis>
                            <generateModels>true</generateModels>
                            <generateModelDocumentation>false</generateModelDocumentation>
                            <generateModelTests>false</generateModelTests>
                            <apisToGenerate>false</apisToGenerate>
                            <withXml>false</withXml>
                        <!--<library>resttemplate</library> --> 
                            <configOptions>
                                <sourceFolder>src/main/java</sourceFolder>
                                <serializableModel>true</serializableModel>
                                <dateLibrary>java8</dateLibrary>
                                <annotationLibrary>none</annotationLibrary>
                                <serializationLibrary>jsonb</serializationLibrary>
                                <additionalModelTypeAnnotations>null</additionalModelTypeAnnotations>
                            <documentationProvider>none</documentationProvider>
                            <additional-properties>generateModelBuilders=true,useJackson=false,sortParamsByRequiredFlag=false,useJacksonJsonIgnoreUnknownProperties=false</additional-properties>
                            </configOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

1 Answer 1

0

This was added in version 5.4.0 in this PR. You'll need to update your plugin version.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.