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

openapi generator is failing #17

Open
dpalic opened this issue Sep 15, 2023 · 2 comments
Open

openapi generator is failing #17

dpalic opened this issue Sep 15, 2023 · 2 comments

Comments

@dpalic
Copy link

dpalic commented Sep 15, 2023

using this definition

openApiSpec=https://raw.githubusercontent.com/InterNetX/internetx-swagger-files/master/src/domainrobot.json

and openapi generator via maven

            <!-- https://mvnrepository.com/artifact/org.openapitools/openapi-generator-maven-plugin -->
            <plugin>
               <groupId>org.openapitools</groupId>
               <artifactId>openapi-generator-maven-plugin</artifactId>
               <version>7.0.0</version>
               <executions>
                  <execution>
                     <goals>
                        <goal>generate</goal>
                     </goals>
                     <configuration>
                        <inputSpec>${openApiSpec}</inputSpec>
                        <generatorName>java</generatorName>
                        <library>resttemplate</library>
                        <apiPackage>${openApiPackage}</apiPackage>
                        <modelPackage>${openApiModelPackage}</modelPackage>
                        <useSpringBoot3>true</useSpringBoot3>
                        <generateApis>true</generateApis>
                        <generateApiDocumentation>false</generateApiDocumentation>
                        <generateApiTests>true</generateApiTests>
                        <generateModels>true</generateModels>
                        <generateModelDocumentation>true</generateModelDocumentation>
                        <generateModelTests>false</generateModelTests>
                        <generateSupportingFiles>true</generateSupportingFiles>
                        <legacyDiscriminatorBehavior>false</legacyDiscriminatorBehavior>
                        <configOptions>
                           <delegatePattern>true</delegatePattern>
                           <additionalModelTypeAnnotations>@lombok.Data</additionalModelTypeAnnotations>
                        </configOptions>
                     </configuration>
                  </execution>
               </executions>
            </plugin>

results into

domainrobot.json [0:0]: unexpected error in Open-API generation
org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
 | Error count: 8, Warning count: 2
Errors: 
	-attribute paths.'/bulk/clientAccount/{label}/clientCustomer'. Declared path parameter label needs to be defined as a path parameter in path or operation level
	-attribute paths.'/bulk/zone/_domainSafe'(put).operationId is repeated
	-attribute paths.'/bulk/zone/_domainSafe'(delete).operationId is repeated
	-attribute paths.'/bulk/domain/_domainSafe'(delete).operationId is repeated
	-attribute paths.'/zone/{name}/{systemNameServer}/zoneQuery/_search'. Declared path parameter name needs to be defined as a path parameter in path or operation level
	-attribute paths.'/zone/{name}/{systemNameServer}/zoneQuery/_search'. Declared path parameter systemNameServer needs to be defined as a path parameter in path or operation level
	-attribute paths.'/bulk/domain/_domainSafe'(put).operationId is repeated
	-attribute paths.'/object/_assignment'(put).operationId is repeated
Warnings: 
	-attribute paths.'/bulk/clientAccount/{label}/clientCustomer'. Declared path parameter label needs to be defined as a path parameter in path or operation level
	-attribute paths.'/bulk/zone/_domainSafe'(put).operationId is repeated
	-attribute paths.'/bulk/zone/_domainSafe'(delete).operationId is repeated
	-attribute paths.'/bulk/domain/_domainSafe'(delete).operationId is repeated
	-attribute paths.'/zone/{name}/{systemNameServer}/zoneQuery/_search'. Declared path parameter name needs to be defined as a path parameter in path or operation level
	-attribute paths.'/zone/{name}/{systemNameServer}/zoneQuery/_search'. Declared path parameter systemNameServer needs to be defined as a path parameter in path or operation level
	-attribute paths.'/bulk/domain/_domainSafe'(put).operationId is repeated
	-attribute paths.'/object/_assignment'(put).operationId is repeated

using

<skipValidateSpec>true</skipValidateSpec>
it is generating but still leaving the feeling that api client will sooner or later fail on the above named issues.
Can someone clarify or even fix the openapi definition?

@Ephenodrom
Copy link
Contributor

Ephenodrom commented Sep 18, 2023

@dpalic
Thank you for the issue! I raised an issue internally and we will try to fix this. This will take a while, but will leave this issue open until the problem is solved. I keep you updated.

Is there any reason your a not using our Java SDK ?

@sdsys-ch
Copy link

sdsys-ch commented Nov 29, 2023

Is there any timeframe in this regard? The OpenAPI spec doesn't validate as is. I'm not using openapitools / java but posted here since my issue (generating for golang) is closely related. Thanks.

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

3 participants