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

Improve testing for converters #316

Merged
merged 10 commits into from
Jan 5, 2023
Merged

Improve testing for converters #316

merged 10 commits into from
Jan 5, 2023

Conversation

idg10
Copy link
Contributor

@idg10 idg10 commented Jan 4, 2023

Resolves #315

Since we're looking to migrate away from Newtonsoft to System.Text.Json (#307) this PR provides much more comprehensive testing for the converters. (Their operation has some non-obvious aspects, particularly due to their reliance on implicit and explicit custom conversions provided by JSON.NET. So we need the behaviour to be well defined by specs.)

This revealed that the ConvertTo for these methods didn't seem to work at all. (It would invariably fail when trying to validate its converted result, because it creates a string, but validation for these types fails unless the input is of the corresponding JToken type.)

Also, there were inconsistencies in how validation failures were being reported, which this fixes.
@idg10 idg10 self-assigned this Jan 4, 2023
@idg10 idg10 marked this pull request as ready for review January 5, 2023 13:25
@idg10 idg10 merged commit 82cc94d into main Jan 5, 2023
@idg10 idg10 deleted the feature/converter-tests branch January 5, 2023 13:35
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.

Inconsistent exceptions thrown when OpenAPI has badly formatted default values
2 participants