Twipped / joi-to-swagger

A library to convert Joi schema objects into Swagger schema definitions
Other
164 stars 63 forks source link

feat: add schemaOverride meta option #74

Closed melchii closed 3 years ago

melchii commented 3 years ago

This meta option will allow users to specify a Joi schema to use for the swagger generation, instead of the schema to which the option is set. The feature is useful in cases where you use the same Joi schema for validation and swagger generation, but the swagger output is incompatible with your application.

For example, AWS API Gateway supports a subset of the swagger spec. In order to utilize this library with AWS API Gateway's swagger, this option is useful when working with Joi.alternatives().