Imagine you are getting some json data, it often ends up in a dto.
But before it gets there the data must be validated against the API Spec so that the existence of fields and the format of the fields etc. matches the expectations.
And often even more it must be validated against some business rules once it passed the format checks. That is a lot of boiler plate and some logic in code is duplicated in the API Spec.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
OpenAPI, just for documentation
Thanks for sharing.
Would you appreciate a small tool that helps to generate validation code out of your OpenAPI specs?
What do you mean? Validation of the API response?
Well more the payload in the response.
Imagine you are getting some json data, it often ends up in a dto.
But before it gets there the data must be validated against the API Spec so that the existence of fields and the format of the fields etc. matches the expectations.
And often even more it must be validated against some business rules once it passed the format checks. That is a lot of boiler plate and some logic in code is duplicated in the API Spec.