We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug:
Doesn't currently seem to support T::Struct prop names.
name
Steps to reproduce:
[1] pry(main)> class X < T::Struct; const :foo, Integer, name: 'bar'; end => T::Private::Types::Void::VOID [2] pry(main)> X.from_hash({ 'bar' => 123 }) => <X foo=123> [3] pry(main)> X.from_hash({ 'foo' => 123 }) RuntimeError: Error in X#__t_props_generated_deserialize: Tried to deserialize a required prop from a nil value. [SNIP] [4] pry(main)> TypeCoerce[X].new.from({ 'bar' => 123 }) ArgumentError: Missing required prop `foo` for class `X` [SNIP] [5] pry(main)> TypeCoerce[X].new.from({ 'foo' => 123 }) => <X foo=123> [6] pry(main)>
Expected behavior:
TypeCoerce[Struct].new.from should probably behave similar to Struct.from_hash.
TypeCoerce[Struct].new.from
Struct.from_hash
Versions:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug:
Doesn't currently seem to support T::Struct prop
name
s.Steps to reproduce:
Expected behavior:
TypeCoerce[Struct].new.from
should probably behave similar toStruct.from_hash
.Versions:
The text was updated successfully, but these errors were encountered: