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

Error generating OpenAPI client from AP OpenAPI specification file. #6

Open
martinhalford opened this issue Jan 17, 2023 · 4 comments

Comments

@martinhalford
Copy link
Member

I've been trying to generate an OpenAPI client using openapi-generator located at: https://openapi-generator.tech.

First tried:

openapi-generator generate -g rust \           
  -i https://github.com/accordproject/apap/blob/main/openapi.json \
  -o accord-rust

However, got errors indicating that the generator was expecting a YAML file.

Therefore, generated YAML file (see attached) by using converter at: https://www.json2yaml.com.

YAML file:
openapi-accord.yaml

Tried this command:

openapi-generator generate -g rust \
  -i ./openapi-accord.yaml \
  -o accord-rust

and got below errors.

errors.txt

Tried a few different generators (e.g. typescript-node) just in case it was something to do with the rust generator but same errors occurred.

@dselman
Copy link
Contributor

dselman commented Jan 17, 2023

Did you try using the --skip-validate-spec as described in the error message? It looks like the generator is imposing some regex on the names of schemas, which is new to me...

@dselman
Copy link
Contributor

dselman commented Jan 17, 2023

Playing with https://apitools.dev/swagger-parser/online/ I do see some errors using openapi.json, so I will dig into that.

@dselman
Copy link
Contributor

dselman commented Jan 17, 2023

Another online validator: https://quobix.com/vacuum/

@martinhalford
Copy link
Member Author

martinhalford commented Jan 19, 2023

Hi @dselman - Yes - I can generate an OpenAPi client when the --skip-validate-spec option is used.

I tried the quobix validator above and got the following report:
https://api.quobix.com/report?url=https://s3.ap-southeast-2.amazonaws.com/images.benext.io/openapi.yaml

The errors mainly seem to be circular or missing references - which, I assume, should be easily fixed?
...plus a heap of warnings which, I assume, aren't that critical?

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