Giter Site home page Giter Site logo

Comments (8)

sebelga avatar sebelga commented on May 25, 2024

Did you put required:true in the Schema for that property?

from gstore-node.

sebelga avatar sebelga commented on May 25, 2024

Closing the issue, feel free to re-open it the above solution didn't work.

from gstore-node.

jfbenckhuijsen avatar jfbenckhuijsen commented on May 25, 2024

Wel, the thing, is, the property isn't actually required. It's allowed from a functional perspective to be undefined.

from gstore-node.

sebelga avatar sebelga commented on May 25, 2024

Ok I see. Would setting it as "optional: true" in the Schema be an option then? The validation would still need to be updated.

from gstore-node.

jfbenckhuijsen avatar jfbenckhuijsen commented on May 25, 2024

optional: true doesn't really change anything. I'm assuming optional: true is the default. Valdation also fails in this case.

from gstore-node.

sebelga avatar sebelga commented on May 25, 2024

Sorry didn't explain myself well. I was asking your opinion. Do you think that defining the property as "optional" would work from a functional perspective? As having a property with a value of undefined or not being present at all in the data object is the same.
I will then need to update the validation to accept undefined as as valid for properties defined with optional: true. And if some value is passed it will do the validation with the "type" and "validate" setting.

from gstore-node.

sebelga avatar sebelga commented on May 25, 2024

After giving it a thought there is no need to declare a property as optional if we already have a required setting. I updated the validation and undefined values should validate correctly on properties that are not defined as required.
Will be included in next release. thanks for reporting.

from gstore-node.

sebelga avatar sebelga commented on May 25, 2024

Closing as v0.7.2 should have fixed it. Let me know if there is still an issue.

from gstore-node.

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.