Skip to content

Validate request bodies using ajv#20

Draft
dachrillz wants to merge 3 commits into
add-post-body-to-har-requestsfrom
validate-request-body
Draft

Validate request bodies using ajv#20
dachrillz wants to merge 3 commits into
add-post-body-to-har-requestsfrom
validate-request-body

Conversation

@dachrillz

Copy link
Copy Markdown
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.
@dachrillz dachrillz requested a review from bittrance August 4, 2022 11:24
required: true
schema:
type: integer
format: int64

Copy link
Copy Markdown
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.

components:
schemas:
Order:
x-swagger-router-model: io.swagger.petstore.model.Order

Copy link
Copy Markdown
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 force-pushed the basic-request-checking branch from 5c32f84 to 46e7d7e Compare August 4, 2022 15:00
@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
@dachrillz dachrillz force-pushed the add-post-body-to-har-requests branch from 05dd717 to f9f07b8 Compare December 14, 2022 12:27
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