Validate request bodies using ajv#20
Draft
dachrillz wants to merge 3 commits into
Draft
Conversation
Now post data is added to incoming requests. This paves the way for veriyfing their content against openapispec in future commits.
We now check the request body to see if content was set. For now only works with application/json
The application now checks if incoming request bodies match the defined schema using ajv. Only applies to application/json.
dachrillz
commented
Aug 4, 2022
| required: true | ||
| schema: | ||
| type: integer | ||
| format: int64 |
Contributor
Author
There was a problem hiding this comment.
See #19
For now I'm just going to say that we don't support custom formats.
We will add them once we feel that ajv works for our use case.
dachrillz
commented
Aug 4, 2022
| components: | ||
| schemas: | ||
| Order: | ||
| x-swagger-router-model: io.swagger.petstore.model.Order |
Contributor
Author
There was a problem hiding this comment.
Is this something we want to support? It's not part of the schema ajv understands out of the box.
It's not hard too add these but I'm not entirerly sure how common they are in the wild!
5c32f84 to
46e7d7e
Compare
Base automatically changed from
basic-request-checking
to
add-post-body-to-har-requests
December 14, 2022 12:13
05dd717 to
f9f07b8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The application now checks if incoming request bodies match the defined
schema using ajv. Only applies to application/json.