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

swagger.json bug from openapi-generator #2445

Open
caniko opened this issue Feb 15, 2023 · 9 comments
Open

swagger.json bug from openapi-generator #2445

caniko opened this issue Feb 15, 2023 · 9 comments
Labels
bug Something isn't working stargate-v1 Issue that only applies to Stargate V1

Comments

@caniko
Copy link

caniko commented Feb 15, 2023

I wanted to generate dart-dio package for Stargate (flutter integration), but got an error during generation. Seems to be an error in the primary key declaration in swagger.json.

Considerations

  1. I have my MVP working already, this was for further development.
  2. Have you considered upgrading to OpenAPI 3.0? Swagger 2.0 is outdated. Not sure how complex this switch would be.

Command:

openapi-generator generate --input-spec stargate_swagger.json --output stargate_dart-dio --generator-name dart-dio --additional-properties=pubName=stargate_api_client,pubVersion=2.0,pubAuthorEmail=canhtart@gmail.com --global-property skipFormModel=false

Error message:

openapi-generator generate --input-spec stargate_swagger.json --output stargate_dart-dio --generator-name dart-dio --additional-properties=pubName=stargate_api_client,pubVersion=2.0,pubAuthorEmail=canhtart@gmail.com --global-property skipFormModel=false
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: 2, Warning count: 0
Errors: 
        -attribute info is missing
        -attribute paths.'/v1/keyspaces/{keyspaceName}/tables/{tableName}/rows/{primaryKey}'. Declared path parameter primaryKey needs to be defined as a path parameter in path or operation level

        at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:620)
        at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:647)
        at org.openapitools.codegen.cmd.Generate.execute(Generate.java:465)
        at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
        at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)
make: *** [makefile:2: star-dio] Error 1
@ivansenic
Copy link
Contributor

ivansenic commented Feb 15, 2023

Where did you find the swagger.json?

@ivansenic ivansenic added bug Something isn't working stargate-v1 Issue that only applies to Stargate V1 labels Feb 15, 2023
@caniko
Copy link
Author

caniko commented Feb 15, 2023

This is accessible through http://127.0.0.1:8082/swagger.json on K8ssandra after port forwarding from the stargate service is active.

@ivansenic
Copy link
Contributor

Possible duplicate of #1011.

Unfortunately, Swagger in stargate v1 is completly broken. We fixed a lot of things in stargate v2. Would you consider upgrading?

@ivansenic
Copy link
Contributor

@jeffreyscarpenter Is there any external swagger.json available for download?

@jeffreyscarpenter
Copy link
Collaborator

@ivansenic do you mean available on the docs site? I don't believe so.

@ivansenic
Copy link
Contributor

@ivansenic do you mean available on the docs site? I don't believe so.

Yes that's what I mean.

@jeffreyscarpenter
Copy link
Collaborator

No, we have not made this available on the docs site. Is there a way we could do this and make sure it is kept up to date when we do releases? @johnsmartco

@caniko
Copy link
Author

caniko commented Feb 17, 2023

We fixed a lot of things in stargate v2. Would you consider upgrading?

I would love to @ivansenic, but I am on K8ssandra and there is no support for V2 yet.

@jeffreyscarpenter
Copy link
Collaborator

No, we have not made this available on the docs site.

Actually I was incorrect, the v2 Swagger references are available

https://stargate.io/docs/latest/develop/attachments/restv2.html
https://stargate.io/docs/latest/develop/attachments/docv2.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stargate-v1 Issue that only applies to Stargate V1
Projects
None yet
Development

No branches or pull requests

3 participants