kogosoftwarellc / open-api

A Monorepo of various packages to power OpenAPI in node
MIT License
892 stars 235 forks source link

Express openapi/add request ajv options and response ajv options[Duplicate of #738] #787

Closed honzapatCZ closed 2 years ago

honzapatCZ commented 2 years ago

Duep of #738 to trigger the CI

iggh commented 2 years ago

I'm of the opinion https://github.com/kogosoftwarellc/open-api/pull/785 would be a cleaner way of providing your own defaults for request ajv options (and other features).

By being able to interrogate the args passed in on instantiation using your own class, it would be infinitely flexible to say, only use specific options for different base paths, or special case a single path that needs specific ajv options as part of the validation.

honzapatCZ commented 2 years ago

I'm of the opinion #785 would be a cleaner way of providing your own defaults for request ajv options (and other features).

By being able to interrogate the args passed in on instantiation using your own class, it would be infinitely flexible to say, only use specific options for different base paths, or special case a single path that needs specific ajv options as part of the validation.

Completely agree. In fact I've created this before I stumbled upon that PR