Coder Social home page Coder Social logo

Comments (10)

buzzware avatar buzzware commented on July 17, 2024 2

The ajv option "removeAdditional: true" does this when the schema has "additionalProperties: false". There are other options for removeAdditional

from open-api.

dkMorlok avatar dkMorlok commented on July 17, 2024 1

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 config removeAdditional: 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.

jsdevel avatar jsdevel commented on July 17, 2024

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.

ksmithut avatar ksmithut commented on July 17, 2024

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.

jsdevel avatar jsdevel commented on July 17, 2024

Any favorite json-schema libraries?

Checkout the dependencies for this project. Ideally we can leverage one of those.

from open-api.

ksmithut avatar ksmithut commented on July 17, 2024

Cool, I'll check it out

from open-api.

jsdevel avatar jsdevel commented on July 17, 2024

@ksmithut how are things going? Is this still an issue?

from open-api.

ksmithut avatar ksmithut commented on July 17, 2024

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.

jsdevel avatar jsdevel commented on July 17, 2024

I like the idea as an enhancement (labeled this as such). If you have time to add the functionality feel free!

from open-api.

jsdevel avatar jsdevel commented on July 17, 2024

@buzzware sounds like you can control this via the schema then? would updating the README suffice?

from open-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.