Closed DrakaSAN closed 5 years ago
@D219 You are using OpenAPI 3.0.0. I don't think this library supports that. https://www.npmjs.com/package/express-openapi-validate or https://www.npmjs.com/package/express-ajv-swagger-validation would work better.
express-openapi-validate
indeed support OpenAPI 3, thanks for the tip.
bin/test.ts:
doc/openapi.yaml:
package.json:
tsconfig.json:
Start the server with
npm start
, call it withcurl --request POST --url http://127.0.0.1:7331/test --header 'content-type: application/json' --data '{}'
Body is missing all properties, yet the validator log nothing nor throw any error.
This look similar to issue 30.