This repository was archived by the owner on Jul 22, 2024. It is now read-only.
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
Decode is missing nil handling / common basic coercions #22
Open
Description
As per the initial comment on #21 I noticed that Decode
will not handle quite a few common cases where there may need to be some basic coercions.
Of particular note in reference to #21 is the fact that a nil
in any value coming from mruby will fail at one of the unknown type
checks.
For nil
specifically I think that using zero types would be most appropriate.
But there are additional cases that it would be nice to handle for completeness.
Some examples:
- decodeString doesn't handle floats or boolean
- decodeFloat doesn't handle fixnum
- decodeInt doesn't handle float (not sure if we should handle this given information loss)
- Nothing handles nil
I propose a table of coercions is produced on this issue and an implementation can stem from that.
Metadata
Metadata
Assignees
Labels
No labels