mkon/openapi_contracts

Request schema validation

Closed this issue · 2 comments

Hi @mkon,

I would really love to see the feature of Request schema validation working similarly to Response schema validation and I see you put it in Future Plans. Do you have any idea when this could be?

I would like to try implementing this myself but first wanted to check with you and see what you think about it, maybe you have some general guidelines or ideas you want me to follow or something like that.

Thank you in advance for your response.
Best regards.

mkon commented

Hey @dveljacic,

I am currently working on a feature that allows generating some kind of coverage report and request body validation would be quite high on the list of the next things to work on, but I can not really say when that is going to happen. Most likely not within the next 1-2 months.

If you want to work on it, you are welcome to submit a PR and I will review it.

Some general ideas how to implement it:

  • add another validator class for the request body and include it in the list of validators
  • add a Request class similar to the Response class and a way to lookup the correct request from the doc similar to the response
  • Also it would make sense for me to bring the refactoring from #40 upstream so we do not have too many conflicts

Closed by: #56