apigee-127 / swagger-tools

A Node.js and browser module that provides tooling around Swagger.
MIT License
701 stars 373 forks source link

Request/Response Validation Question? #558

Closed BarrieP closed 6 years ago

BarrieP commented 6 years ago

Apologies if this is documented somewhere ( I have looked, but can't find... so if so, please just direct me to it ).

I'm trying to understand what the capabilities are for request and response validation.

i.e. min.max string lengths, regex, etc.

I've been directed to use Joi, but it'd be better for me if I could just pop the constraints in the swagger file, and let the tooling do the rest.

whitlockjc commented 6 years ago

swagger-tools provides full validation of requests/responses based on your OAS/Swagger document. Since OAS/Swagger is built on top of JSON Schema, constraints like the ones you mentioned are supported.