Code Monkey home page Code Monkey logo

typesync's People

Contributors

kafkas avatar seymurkafkas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

typesync's Issues

Generation should fail for incorrect discriminant

The following definition doesn't produce an error when it should. Instead, the generator produces a simple union.

Pet:
  model: alias
  type:
    type: union
    discriminant: type
    variants:
      - type: object
        fields:
          type:
            type:
              type: literal
              value: dog
          breed:
            type: string
      - type: map
        of: string

Feature Request(s)

Hi - thanks for creating this project, was looking for something to help with this exact use case as have a mixed Python BE and TS FE using Firestore with both.

Have a few feature ideas that I hope help make the library more useful (some of which already have open "Issues" so are hopefully planned):

  • Right now I can only create a map as an Alias, and then use that to a Document - would be great to specify on the Document directly (dup of #87?)
  • An Unknown, or Any type would be really useful for more freeform schemas (dup of #57?)
  • Ability to support additional (typed or Any type) properties on a document, atm I am collecting them in a nested map but this makes the code more complex

Some nice to haves in the future,

  • Ability to use an existing Pydantic parent class or Config
  • Support for Firebase SERVER_TIMESTAMP

Thanks!

Implement `keyof` type

This will let users create enums from object keys. May also provide a way to create enums from discriminant literals (tbd).

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.