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

Validate request bodies using ajv #20

Draft
wants to merge 3 commits into
base: add-post-body-to-har-requests
Choose a base branch
from

Conversation

dachrillz
Copy link
Contributor

The application now checks if incoming request bodies match the defined
schema using ajv. Only applies to application/json.

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.
@@ -201,7 +201,6 @@ paths:
required: true
schema:
type: integer
format: int64
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@@ -610,23 +601,18 @@ externalDocs:
components:
schemas:
Order:
x-swagger-router-model: io.swagger.petstore.model.Order
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

@dachrillz dachrillz marked this pull request as draft August 4, 2022 15:59
Base automatically changed from basic-request-checking to add-post-body-to-har-requests December 14, 2022 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant