accordproject / apap

Accord Project Agreement Protocol
3 stars 1 forks source link

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

Open martinhalford opened 1 year ago

martinhalford commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

dselman commented 1 year ago

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

martinhalford commented 1 year ago

Hi @dselman - Yes - I can generate an OpenAPi client when the --skip-validate-specoption 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?