InterNetX / domainrobot-api

Swagger documentation for different APIs powered by InterNetX GmbH.
MIT License
18 stars 9 forks source link

openapi generator is failing #17

Open dpalic opened 9 months ago

dpalic commented 9 months ago

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 commented 9 months ago

@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 commented 7 months ago

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.