PayU / openapi-validator-middleware

Input validation using Swagger (Open API) and ajv
Apache License 2.0
144 stars 50 forks source link

Not validating if there is required header or query param #185

Open ganeshbala2008 opened 2 years ago

ganeshbala2008 commented 2 years ago

Versions: openapi-validator-middleware: 3.2.6 fastify: 3.28.0 node: 16.14.0 openapi: 3.0.1 Router: Fastify

I am validating the request payload and header using the middleware. The validation is not happening when we have the required parameter as true for the header and query param.

For example, Header: site: test required: true queryparam: filter: {} required: false

In the above scenario, the validation happens if both are not present, Say if we have querparams the validation get bypassed

thegu5 commented 1 year ago

Can confirm, same issue here

ganeshbala2008 commented 1 year ago

@thegu5 Issue still persists