oxidecomputer / progenitor

An OpenAPI client generator
489 stars 62 forks source link

Check OpenAPI version before proceeding #674

Open holtgrewe opened 9 months ago

holtgrewe commented 9 months ago

Using this JSON:

I get the following error with a cargo install cargo-progenitor that I did a few minutes ago:

# cargo progenitor -i openapis/panelapp.json -o ../panelapp -n panelapp -v 0.1.0
Error: paths: data did not match any variant of untagged enum ReferenceOr at line 36 column 12
ahl commented 8 months ago

This is a Swagger 2.0 document which has a slightly different format than OpenAPI 3.0.x. There's a bug here in that the command should check the document version before proceeding. You may try a 2.0 -> 3.0.x converter--I'm pretty sure some exist.

holtgrewe commented 8 months ago

@ahl thanks

ahl commented 8 months ago

I'm going to re-open this because the CLI should definitely validate this before proceeding.