match() throws an error if no matching validator is found. Fixes #64. #67
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello 👋
Here is a breaking change to
match()
. I've implemented it as discussed in #64 and #63. Nowmatch()
will throw an error when no matching routes are found from OpenAPI schema. The error is an instance ofValidationError
without the.data
array.To skip the error you can invoke
match({ allowNoMatch: true })
.There was also a bug in the original tests for
match
. There was no matching path for/match/works-with-url-param
in the OpenAPI schema. Thusmatch()
did not invoke any validators and the test yielded a false negative. This was fixed by the first commit in this pull request.Would this be ok to be published as
0.6.0
? Feel free to edit anything as you wish. I'll be happy to help with this one further. Let me know if e.g. changes toValidationError
are not welcome.