Giter Site home page Giter Site logo

`infer_discriminator` about pydantic HOT 3 OPEN

samuelcolvin avatar samuelcolvin commented on June 3, 2024
`infer_discriminator`

from pydantic.

Comments (3)

dmontagu avatar dmontagu commented on June 3, 2024

If necessary for the use cases you have in mind, I think we could also do this with functional discriminators in the case where there is a required field that is only present in one of the cases. If inferring for literals/enum discriminators is enough then that's probably less effort

from pydantic.

samuelcolvin avatar samuelcolvin commented on June 3, 2024

I guess we make the setting:

  • False - don't infer, current behaviour
  • simple - literals only
  • exhaustive - try all the things we can reasonably think of to create a discriminator

Since this method will be on GenerateSchema , any more complex semantics can be implemented by uses.

from pydantic.

NeevCohen avatar NeevCohen commented on June 3, 2024

@samuelcolvin Hey, I'd like to pick this up if it's still available

from pydantic.

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.