Giter VIP home page Giter VIP logo

sorbet-schema's People

Contributors

abhasavanich avatar dependabot[bot] avatar github-actions[bot] avatar maxveldink avatar

Stargazers

 avatar  avatar

Watchers

 avatar

sorbet-schema's Issues

Add ability to set custom type serializer

We have support for adding a serializer to a field to change its serialization behavior; it would be nice to be able to set a serializer based on a type that would be used for any matching type in a schema.

Add type validations

When we ApplyValidators, we should check the field type against the given value. For now, we won't do any coercion and simply return validation issues that we see.

Resolve T::Struct warning during test runs

While running the test suite, we see the following warnings a few times:

(eval at /Users/maxveldink/.asdf/installs/ruby/3.3.0/lib/ruby/gems/3.3.0/gems/sorbet-runtime-0.5.11284/lib/types/props/has_lazily_specialized_methods.rb:65):1: warning: method redefined; discarding old __t_props_generated_deserialize
/Users/maxveldink/.asdf/installs/ruby/3.3.0/lib/ruby/gems/3.3.0/gems/sorbet-runtime-0.5.11284/lib/types/props/has_lazily_specialized_methods.rb:91: warning: previous definition of __t_props_generated_deserialize was here

I'm not quite sure why we're redefining methods, but we should try and suppress this warning.

When serializing Structs, use their `schema`

Conventionally, we expect a Struct to define a .schema class method for it's schema (a default is implemented on all of them via struct_ext.rb.) We should defer to this when we're doing struct serialization as well

`CoercionNotSupportedError` not easy to debug

these errors are not obvious to debug:
Failed to deserialize response: Typed::Coercion::CoercionNotSupportedError

Adding the field name, source and destination types, and what was the value that was used

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.