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

fix: force yaml loading to confirm to json-compatible types #1

Merged
merged 1 commit into from
Dec 8, 2021

Conversation

erunion
Copy link
Member

@erunion erunion commented Dec 8, 2021

This fix was taken from a fix of mine upstream in APIDevTools#247:

While investigating some @apidevtools/swagger-parser quirks I discovered that loading a YAML file that contains a date-like string causes that date to be converted into a Date object, causing the API definition to fail validation.

This updates the usage of js-yaml to ensure that all YAML content conforms to JSON-compatible types by way of its schema option (docs here).

@erunion erunion added the bug Something isn't working label Dec 8, 2021
@erunion erunion merged commit 8e72af3 into main Dec 8, 2021
@erunion erunion deleted the fix/dates-as-strings branch December 8, 2021 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant