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

Updated known-errors to make CI work again #165

Merged
merged 1 commit into from
Jun 24, 2021

Conversation

seriousme
Copy link
Contributor

Running npm run node:test failed because some API's fail to pass validation.
This PR assumes that these are all bugs in specifications and not in swagger-parser.

It should make CI on swagger-parser succeed again so we can continue its development.
(esp. adding support for v3.1 ;-))

Kind regards,
Hans

@philsturgeon philsturgeon merged commit bbf139e into APIDevTools:master Jun 24, 2021
@philsturgeon
Copy link
Member

Thank you @seriousme, but we've still got some errors. I got the Actions running again by adding on: pull_request but they're kicking up some errors now.

@seriousme
Copy link
Contributor Author

seriousme commented Jun 24, 2021

I just checked:

642 apis failed of which:

631 apis (mostly AWS + Azure) fail because of a bug in YAML parsing:

version: 2015-09-21

is now parsed as an object instead of a string , the error message is:
"Expected type string but found type object at #/info/version"

adyen.com:MarketPayNotificationService is a 3.1 spec :-)
see: https://api.apis.guru/v2/specs/adyen.com/MarketPayNotificationService/6/openapi.yaml

4 gitHub apis fail because of a MissingPointerError, errormessage is Token "expires_at" does not exist.
example: 'https://api.apis.guru/v2/specs/github.com/ghes-2.18/1.1.4/openapi.yaml',

3 gitHub apis fail because of a MissingPointerError, errormessage is Token "0" does not exist.
example: 'https://api.apis.guru/v2/specs/github.com/ghes-2.22/1.1.4/openapi.yaml',

3 other api's fail because of various errors (probably bugs in their spec):

Hope this helps ;-)

Hans

@seriousme seriousme deleted the update-known-errors branch June 24, 2021 18:42
@seriousme
Copy link
Contributor Author

Did some more digging:

YAML 1.2 specifies that 2015-09-21 should be read as a date. Hence JS-Yaml makes a date object out of it.

The problem lies in:

return yaml.load(data);

at https://github.com/APIDevTools/json-schema-ref-parser/blob/7a899bcb41820c883e2d434e6bed675604f4d32c/lib/parsers/yaml.js#L48

if you replace this by:

return yaml.load(data, {schema: yaml.JSON_SCHEMA });

Then it should work again for these cases :-)
I have tested this using https://www.npmjs.com/package/@seriousme/openapi-schema-validator and it works there. So it should work here as well.
This also solved the github cases !

Kind regards,
Hans

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

Successfully merging this pull request may close these issues.

2 participants