express-openapi-validator icon indicating copy to clipboard operation
express-openapi-validator copied to clipboard

Feature Request: Error on additional properties

Open leeleahulkcs opened this issue 1 year ago • 0 comments

In the OpenAPI spec, for object types, I add additionalProperties: false.

With this project, using the removeAdditional for both validateRequests and validateResponses, I can have all additional properties removed.

I noticed and tested that unknown query parameters will cause an error to be returned instead of a silent removal.

A similar project https://github.com/kogosoftwarellc/open-api/tree/main/packages/openapi-response-validator, will return an error when an additional property is found.

I would like to request that this project add a configuration option to both validateRequests and validateResponses so that an additional property will cause an error to be returned instead of a silent removal. This is to match the current behavior of allowUnknownQueryParameters and the other similar project.

leeleahulkcs avatar Nov 29 '24 19:11 leeleahulkcs