Git Product home page Git Product logo

Comments (4)

Grokzen avatar Grokzen commented on July 29, 2024

Wait... just so i get this right. Do you want the schema to do a Deep merge between two different schemas into one single schema inside the lib itself and then do the merged validation on the data part? So in your example, the merged schema would be this?

type: map
mapping:
  level1:
    required: True
    type: map
    mapping:
      level2a:
        type: str
      level2b:
        type: str

from pykwalify.

christian-oreilly avatar christian-oreilly commented on July 29, 2024

That would be the idea. I could do it upstream in my code and submit only the "merged" schema to PyKwalify, but it seemed like a feature that would sit better in PyKwalify (being reusable by other have a similar use case) than in my package where it would be harder to reuse in other projects.

from pykwalify.

Grokzen avatar Grokzen commented on July 29, 2024

@christian-oreilly I and strongly leaning towards not supporting this feature mainly due to the reason that if i make some kind of schema union feature, i would have to take a strong stance on several different cases in how the union works with deep and nested data structures. And i am not willing to go down that route and define a certain method or rule set for how it would work inside the pykwalify core. I have in the past been thinking about the same kind of issue and same as then, i passed on it as it would just lead to more code to maintain and probably so many more config and tweak options down the line that i am just not willing to support in the end and would probably casue more harm or issues then what it is worth for me.

Basically what i am saying, is that it is not up to pykwalify to define how a schema union would work out, that Must be solved by the person that uses this tool. You have to provide a fully done schema to pykwalify and i will not change this behaviour.

If you are using this code as a lib inside your own application, then it should not be difficult to merge them before you send them into the Core class here.

from pykwalify.

christian-oreilly avatar christian-oreilly commented on July 29, 2024

Sure, no problem. I'll implement it on my side, Thanks for the fast feedback.

from pykwalify.

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.