paperclip-rs / paperclip

WIP OpenAPI tooling for Rust.
Apache License 2.0
891 stars 117 forks source link

Support Sendgrid OpenAPI v2 spec #282

Open nacardin opened 3 years ago

nacardin commented 3 years ago

Currently the Sendgrid OpenAPI 2.0 specs provided at https://github.com/sendgrid/sendgrid-oai fail to parse.

Yaml:

$ wget https://raw.githubusercontent.com/sendgrid/sendgrid-oai/main/oai.yaml
$ paperclip --api v2 oai.yaml

results in:

error: Invalid value for '<spec>': YAML error: paths./mail/send: data did not match any variant of untagged enum Either at line 27 column 9

Json

$ wget https://raw.githubusercontent.com/sendgrid/sendgrid-oai/main/oai.json
$ paperclip --api v2 oai.json

results in:

error: Invalid value for '<spec>': JSON error: data did not match any variant of untagged enum Either at line 474 column 9

These files validate with swagger-cli.

$ swagger-cli validate oai.yaml
oai.yaml is valid

$ swagger-cli validate oai.json
oai.json is valid

Great work so far on this library!

brownjohnf commented 2 years ago

I've had a possibly related issue with the CircleCI v2 API spec located at the top of https://circleci.com/docs/api/v2/:

$ paperclip --api v3 swagger.json
error: Invalid value for '<spec>': JSON error: missing field `swagger` at line 9858 column 1