Comments (10)
The ajv option "removeAdditional: true" does this when the schema has "additionalProperties: false". There are other options for removeAdditional
from open-api.
I'm dealing with same/similar problem, need to remove additional data without throwing errors.
- when i set
"additionalProperties: false"
into schema validator throw errors - when i add to
Ajv
configremoveAdditional: true
it removes additional data and not throws errors
Very helpful is this test https://github.com/ajv-validator/ajv/blob/ba752505cf53a136eda1c4f4b81bf9e697a42dc2/spec/options/removeAdditional.spec.ts#L27
Would be nice to have ajv options configurable for openapi-request-validator
, or at least just this one removeAdditional
.
(using only component openapi-request-validator
)
UPDATE: i want to remove additional data from body.
from open-api.
I like the idea a lot. It would probably make sense as middelware in this project for now. If you'd like to add a PR feel free.
from open-api.
Cool, I'll take a look :) When I was attempting to build a swagger type api "thing" once upon a time, I relied on ajv to do my parsing and stripping and stuff. Might need to do something like that for body
. Any favorite json-schema libraries?
from open-api.
Any favorite json-schema libraries?
Checkout the dependencies for this project. Ideally we can leverage one of those.
from open-api.
Cool, I'll check it out
from open-api.
@ksmithut how are things going? Is this still an issue?
from open-api.
I haven't had time to look into get... Got back into the swing at work and such. Feel free to close this out.
from open-api.
I like the idea as an enhancement (labeled this as such). If you have time to add the functionality feel free!
from open-api.
@buzzware sounds like you can control this via the schema then? would updating the README suffice?
from open-api.
Related Issues (20)
- openapi-types incompatible with TypeScript 4.8 HOT 1
- TypeScript 4.8 fails with `openapi-types` HOT 2
- Only validate first item when using ref in array
- Allow openapi-types extensions of other things than `OperationObject` HOT 1
- [openapi-schema-validator] Add support for OAS v3.1.0 schema HOT 6
- Load `.ts` route file HOT 6
- Quick Question: Can we parse a list of param in a PostgREST format ?
- [express-openapi] How to integrate with passport-azure-ad?
- Invalid query validation when using oneOf
- openapi-request-validator doesn't validate JSON objects given in headers or query params HOT 1
- Type 'string' is not assignable to type 'NonArraySchemaObjectType | undefined'. HOT 4
- [express-openapi] How to open the swagger UI web interface? HOT 1
- express-openapi: Unclear how to validate successful completion of tutorial HOT 5
- pnpm and glob issue in express-openapi
- Add application/json content type support in openapi-request-coercer
- Add support for `prefixItems` HOT 3
- SyntaxError: Invalid regular expression during path-to-regexp conversion HOT 4
- openapi-framework: fixed windows path names HOT 4
- [enhancement] openapi-response-validator: native ESM node modules default export not working as intended HOT 3
- [ft. request] openapi-response-validator - allow access to response param in errorTransformer HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from open-api.