You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know this is out of the scope of this library, but I am asking here to see if someone have already given a thought about this and solved it somehow within the openapi ecosystem.
A lot of boilerplate in any api service has to do with validating user's input. There are all kind of json schema validators and if you're using Typescript, you can use something like class-validator to decorate your classes and validate the user's input according to the requirements.
Ideally, we should write the openapi definitions one time in our code base with openapi-comment-parser syntax and then somehow use it to validate the requests according to the spec. I guess this will require "compiling" the comments into a openapi spec file and then using one of the validators to verify the user's input.
Has anyone tried anything like this before and can suggest an approach that worked for them ?
Thank you for this library
The text was updated successfully, but these errors were encountered:
I know this is out of the scope of this library, but I am asking here to see if someone have already given a thought about this and solved it somehow within the openapi ecosystem.
A lot of boilerplate in any api service has to do with validating user's input. There are all kind of json schema validators and if you're using Typescript, you can use something like class-validator to decorate your classes and validate the user's input according to the requirements.
Ideally, we should write the openapi definitions one time in our code base with openapi-comment-parser syntax and then somehow use it to validate the requests according to the spec. I guess this will require "compiling" the comments into a openapi spec file and then using one of the validators to verify the user's input.
Has anyone tried anything like this before and can suggest an approach that worked for them ?
Thank you for this library
The text was updated successfully, but these errors were encountered: