InterNetX / js-domainrobot-sdk

A javascript package for easy integration of the Domainrobot API powered by InterNetX GmbH.
MIT License
11 stars 7 forks source link

OpenAPI Specification Invalid #112

Closed DKierner closed 5 days ago

DKierner commented 5 months ago

When trying to generate an API client with the OpenAPI generator, the OpenAPI specification is invalid.

This has already been mentioned in InterNetX/domainrobot-api/issues/17 in September 2023. The last question in the mentioned thread was not followed up on, which is why I ask again: Can you give an estimate when this will be fixed?

TODO

Error Logs

OpenAPI Specification from the Documentation

Generating an API client with the command openapi-generator-cli generate -g python -i https://raw.githubusercontent.com/InterNetX/internetx-swagger-files/master/src/domainrobot.json leads to an error message:

Exception in thread "main" 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

        at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:717)
        at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:744)
        at org.openapitools.codegen.cmd.Generate.execute(Generate.java:527)
        at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
        at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)

Latest OpenAPI Specification Generated with the Latest Commit

Generating the OpenAPI specification with, but not from, the latest commit, f8a275d as of 02.05.2024, does lead to one error less, but more warnings.

yarn update:specs
cd ..
openapi-generator-cli generate -g python -i js-domainrobot-sdk/src/swagger/domainrobot.json

Executing the previous script leads to the following error messages:

Exception in thread "main" 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: 7, Warning count: 7
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
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

        at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:717)
        at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:744)
        at org.openapitools.codegen.cmd.Generate.execute(Generate.java:527)
        at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
        at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)

Outdated OpenAPI Specification Generated from the Latest Commit

If generated from the last commit f8a275d, the OpenAPI specification is in the state of commit 0d5360a with openapi-generator-cli generate -g python -i https://raw.githubusercontent.com/InterNetX/js-domainrobot-sdk/master/src/swagger/domainrobot.json and has more errors and warnings than any of the previous specifications:

Exception in thread "main" 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: 18, Warning count: 12
Errors: 
        -attribute paths.'/context/{context}/host'(post).operationId is repeated
        -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.'/parking/domain/_search'(post).operationId is repeated
        -attribute paths.'/bulk/zone/_domainSafe'(delete).operationId is repeated
        -attribute paths.'/context/{context}/host/{host}/_csr'. Declared path parameter host needs to be defined as a path parameter in path or operation level
        -attribute paths.'/bulk/domain/_domainSafe'(delete).operationId is repeated
        -attribute paths.'/intern/billing/{id}/_drop'. Declared path parameter id needs to be defined as a path parameter in path or operation level
        -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.'/intern/billing/{id}/_reactivate'. Declared path parameter id 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.'/object/_assignment'(put).operationId is repeated
        -attribute paths.'/discount/{id}'(put).operationId is repeated
        -attribute paths.'/context/{context}/document/{key}'(post).operationId is repeated
        -attribute paths.'/bulk/zone/_domainSafe'(put).operationId is repeated
        -attribute paths.'/context/{context}/host/{host}/_upgrade'. Declared path parameter host needs to be defined as a path parameter in path or operation level
        -attribute paths.'/intern/billing/{id}/_reject'. Declared path parameter id needs to be defined as a path parameter in path or operation level
        -attribute paths.'/context/{context}/document/{key}'. Declared path parameter key needs to be defined as a path parameter in path or operation level
        -attribute paths.'/bulk/domain/_domainSafe'(put).operationId is repeated
Warnings: 
        -attribute paths.'/context/{context}/host'(post).operationId is repeated
        -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.'/parking/domain/_search'(post).operationId is repeated
        -attribute paths.'/bulk/zone/_domainSafe'(delete).operationId is repeated
        -attribute paths.'/context/{context}/host/{host}/_csr'. Declared path parameter host needs to be defined as a path parameter in path or operation level
        -attribute paths.'/bulk/domain/_domainSafe'(delete).operationId is repeated
        -attribute paths.'/intern/billing/{id}/_drop'. Declared path parameter id needs to be defined as a path parameter in path or operation level
        -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.'/intern/billing/{id}/_reactivate'. Declared path parameter id 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.'/object/_assignment'(put).operationId is repeated
        -attribute paths.'/discount/{id}'(put).operationId is repeated
        -attribute paths.'/context/{context}/document/{key}'(post).operationId is repeated
        -attribute paths.'/bulk/zone/_domainSafe'(put).operationId is repeated
        -attribute paths.'/context/{context}/host/{host}/_upgrade'. Declared path parameter host needs to be defined as a path parameter in path or operation level
        -attribute paths.'/intern/billing/{id}/_reject'. Declared path parameter id needs to be defined as a path parameter in path or operation level
        -attribute paths.'/context/{context}/document/{key}'. Declared path parameter key needs to be defined as a path parameter in path or operation level
        -attribute paths.'/bulk/domain/_domainSafe'(put).operationId is repeated

        at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:717)
        at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:744)
        at org.openapitools.codegen.cmd.Generate.execute(Generate.java:527)
        at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
        at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)
adelholtz commented 5 days ago

Hi

as mentioned in the other issues you created please report this directly in https://github.com/InterNetX/domainrobot-api/issues as this SDK does not directly create this swagger documentation.

Thank you.