Pylons / Pylons/pyramid_openapi3
Fail validation for extra data
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 84
- Forks
- 46
- Avg merge
- 5d 20h
- Merged PRs (30d)
- 3
Description
Suppose your openapi.yaml defines two string fields, title & `description. Both are required.
- Scenario A:
You send the following data to the API:
{
'title': 'foo',
'descriptioin': 'bar'
}
And the API will tell you that description field is required and you notice the descriptioin typo in your request.
- Scenario B:
You change the openapi.yaml so that descriptioon is no longer a required field.
You send the following data to the API:
{
'title': 'foo',
'descriptioin': 'bar'
}
And the API will silently ignore descriptioin field, and since description 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 😱 😱 😱
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the request-validation behavior driven by the repository's openapi.yaml schema and reproduce both request scenarios from the issue. Trace how unknown fields are handled, then verify that a misspelled optional field is not silently accepted and that the API reports the invalid input instead of returning success.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100