nextcloud / neon

A framework for building convergent cross-platform Nextcloud clients using Flutter.
Other
121 stars 29 forks source link

Allow decoding of `2.0` into an integer #1893

Open Leptopoda opened 5 months ago

Leptopoda commented 5 months ago

https://json-schema.org/understanding-json-schema/reference/numeric

This should be easilly doable with a custom integer serializer similar to the one we have for doubles

provokateurin commented 5 months ago

I'm tempted to say this is just bad API design if you ever encounter it...

Leptopoda commented 5 months ago

but it is also easy to fix :woman_shrugging:

Leptopoda commented 4 months ago

marking as a good first issue; The following links might be helpful

https://github.com/nextcloud/neon/blob/397c91131aa4272af8c52dadc909ed45536a511f/packages/dynamite/dynamite_runtime/lib/src/built_value/double_serializer.dart#L5 https://github.com/google/built_value.dart/blob/8b118ac405750ffc24aaed7b88262a4abccdb397/built_value/lib/src/int_serializer.dart#L8