-
Notifications
You must be signed in to change notification settings - Fork 47
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
Fail validation for extra data #45
Comments
This one needs to be re-reproduced because |
This makes sense to me, as you might want to push data across and not care about sanitising to match the specific fields an endpoint is interested in. That said, I totally agree that it's shady to fail to warn users about fields being ignored. Equally, we don't want to break valid requests that happen to contain extraneous keys right now, whenever people upgrade. I can think of four broad approaches:
|
|
Suppose your
openapi.yaml
defines two string fields,title
& `description. Both are required.You send the following data to the API:
And the API will tell you that
description
field is required and you notice thedescriptioin
typo in your request.You change the
openapi.yaml
so thatdescriptioon
is no longer a required field.You send the following data to the API:
And the API will silently ignore
descriptioin
field, and sincedescription
is no longer required, will return a 200 OK. You move on and then notice after two weeks that you haven't saved any data 😱 😱 😱The text was updated successfully, but these errors were encountered: