Giter VIP home page Giter VIP logo

Comments (13)

tomchristie avatar tomchristie commented on May 18, 2024 3

@ddorian We can't use marshmallow (or any other existing library) here because they wouldn't fulfil our design criteria of:

  • Actual type subclasses, that we can then validly use as type annotations.
  • 1:1 mapping onto JSON Schema.

from apistar.

thedrow avatar thedrow commented on May 18, 2024 2

May I suggest PyDantic?
It supports type annotations out of the box and type subclasses.
It's pretty young but so is APIStar so it's still a good opportunity to switch.

from apistar.

hsharrison avatar hsharrison commented on May 18, 2024 1

Is there any movement on Nullable? Or is there a workaround? I'm trying to setup apistar with SQLAlchemy and I get validation errors when None is passed to a schema, even if there is a default. I can't figure out any way to make it work.

from apistar.

pslacerda avatar pslacerda commented on May 18, 2024 1

APIStar is a very enjoyable framework with a lot of nice ideas.

@thedrow I just made a library to APIStar use PyDantic as typesystem. Seems fine to me, I really liked it. https://github.com/pslacerda/apistar_pydantic/

Enum and list needs more testing. Optional (or nullable) , Union and recursive models support aren't done yet.

Maybe you should use Optional for nullable fields, but maybe is better to add Object(nullable=True) as it look less ugly.

Keep the good work!

from apistar.

ddorian avatar ddorian commented on May 18, 2024

... why not just use marshmallow ? Aren't you doing too much this way (like django with friends) ?
The same for swagger etc.

from apistar.

tomchristie avatar tomchristie commented on May 18, 2024

Not yet, tho certainly on the immediate roadmap yup.
Sketching out next steps, here... https://github.com/encode/apistar/projects/1

from apistar.

agalera avatar agalera commented on May 18, 2024

required will be a future argument?

from apistar.

tomchristie avatar tomchristie commented on May 18, 2024

Most likely that, or something similar yes, but needs some thinking about first.

from apistar.

7robertodantas avatar 7robertodantas commented on May 18, 2024

Is there any way to define a schema property as read only? I am needing that to use in a property like 'id', to prevent user send an id in a create / post method.

p.s: So far APIStar is the best api framework I've ever seen and used.

from apistar.

viking avatar viking commented on May 18, 2024

Any plans yet to add a way to make a field be required? I've tried typesystem.string(min_length=1) and it seems to allow missing a field.

from apistar.

viking avatar viking commented on May 18, 2024

Aha, I found the required option for typesystem.Object.

from apistar.

zywind avatar zywind commented on May 18, 2024

Any progress on supporting nullable? typesystem.Object would become really useful with it.

from apistar.

robertorobles avatar robertorobles commented on May 18, 2024

Will it be possible to use Union as a type?

from apistar.

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.