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

Support 'allowReserved' property when validating form-data body #497

Closed
chris-miaskowski opened this issue Jul 26, 2019 · 0 comments · Fixed by #630
Closed

Support 'allowReserved' property when validating form-data body #497

chris-miaskowski opened this issue Jul 26, 2019 · 0 comments · Fixed by #630
Assignees

Comments

@chris-miaskowski
Copy link
Contributor

User story.
As a Prism user, I can OAS3 body parameter encoding to allow reserved characters, so that I can handle more real life corner cases.

Additional context

Note that this test should already exist in the source code. At the time of writing this issue up it exited on a feature branch under test-harness/specs/validate-body-params/form-data-allow-reserved-fail.oas3.txt.unsupported

====test====
Send reserved characters in body and expect to fail validation.
====spec====
openapi: '3.0.1'
paths:
/path:
post:
responses:
200:
content:
text/plain:
example: ok
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
reserved:
type: string
encoding:
reserved:
contentType: text/plain
allowReserved: false
style: form
====server====
mock -p 4010
====command====
curl -i -X POST http://localhost:4010/path -H "Content-Type: application/x-www-form-urlencoded" --data "reserved=:/?#[]@!$&'()*+,;"
====expect====
HTTP/1.1 422 Unprocessable Entity
content-type: application/problem+json
Connection: keep-alive

{ "to-be": "done" }

@chris-miaskowski chris-miaskowski added this to the On Deck milestone Jul 26, 2019
@philsturgeon philsturgeon removed this from the On Deck milestone Aug 14, 2019
@karol-maciaszek karol-maciaszek self-assigned this Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants