Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generation with openapi-generator fails #6

Open
dpalic opened this issue Oct 8, 2023 · 1 comment
Open

Generation with openapi-generator fails #6

dpalic opened this issue Oct 8, 2023 · 1 comment

Comments

@dpalic
Copy link

dpalic commented Oct 8, 2023

I am failing with generating with this maven plugin

            <!-- https://mvnrepository.com/artifact/org.openapitools/openapi-generator-maven-plugin -->
            <plugin>
               <groupId>org.openapitools</groupId>
               <artifactId>openapi-generator-maven-plugin</artifactId>
               <version>7.0.1</version>
               <executions>
                  <execution>
                     <goals>
                        <goal>generate</goal>
                     </goals>
                     <configuration>
                        <inputSpec>https://raw.githubusercontent.com/DeepLcom/openapi/main/openapi.yaml</inputSpec>
                        <apiPackage>com.example.deepl.generated.api</apiPackage>
                        <modelPackage>com.example.deepl.generated.api.model</modelPackage>
                        <generatorName>java</generatorName>
                        <library>resttemplate</library>
                        <useSpringBoot3>true</useSpringBoot3>
                        <skipValidateSpec>true</skipValidateSpec>
                        <generateApis>true</generateApis>
                        <generateModels>true</generateModels>
                        <generateSupportingFiles>true</generateSupportingFiles>
                        <generateClientAsBean>true</generateClientAsBean>
                        <legacyDiscriminatorBehavior>false</legacyDiscriminatorBehavior>
                        <generateApiTests>true</generateApiTests>
                        <generateModelTests>true</generateModelTests>
                        <generateApiDocumentation>true</generateApiDocumentation>
                        <generateModelDocumentation>true</generateModelDocumentation>
                        <configOptions>
                           <delegatePattern>true</delegatePattern>
                           <additionalModelTypeAnnotations>@lombok.Data; @edu.umd.cs.findbugs.annotations.SuppressFBWarnings</additionalModelTypeAnnotations>
                          <additionalEnumTypeAnnotations>@edu.umd.cs.findbugs.annotations.SuppressFBWarnings</additionalEnumTypeAnnotations>
                           <additionalOneOfTypeAnnotations>@edu.umd.cs.findbugs.annotations.SuppressFBWarnings</additionalOneOfTypeAnnotations>
                        </configOptions>

                        <configHelp>false</configHelp>
                     </configuration>
                  </execution>
               </executions>
            </plugin>

TranslateTextApi is getting generated with

import com.example.deepl.generated.api.model.TranslateTextRequest;
import com.example.deepl.generated.api.model.TranslateTextRequest1;

But the TranslateTextRequest1 is not getting generated at all so that my generated code is

TranslateTextRequest1 cannot be resolved
@JanEbbing
Copy link
Member

That seems like a bug with this generator, which we don't offer support for (at least I can't find anything in the OpenAPI spec which would cause that). Regardless, is there a reason you're not just using the official Java library we offer instead of generating one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants