-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
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
experiment/issue-175-encoders-without-json-du #188
experiment/issue-175-encoders-without-json-du #188
Conversation
packages/Thoth.Json.Core/Encode.fs
Outdated
let inline sbyte (value: sbyte) = | ||
{ | ||
new IEncodable with | ||
member this.Encode(helpers) = | ||
helpers.encodeIntegralNumber(uint32 value) | ||
} | ||
|
||
let inline byte (value: byte) = | ||
{ | ||
new IEncodable with | ||
member this.Encode(helpers) = | ||
helpers.encodeIntegralNumber(uint32 value) | ||
} | ||
|
||
let inline int16 (value: int16) = | ||
{ | ||
new IEncodable with | ||
member this.Encode(helpers) = | ||
helpers.encodeIntegralNumber(uint32 value) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note fo later:
We should probably not cast to uint32
see #187
packages/Thoth.Json.Core/Encode.fs
Outdated
let inline int (value: int) = | ||
{ | ||
new IEncodable with | ||
member this.Encode(helpers) = | ||
helpers.encodeIntegralNumber(uint32 value) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note fo later:
We should probably not cast to uint32
see #187
Thank you for the PR and showing me that it was indeed possible to defer the concrete representation of the JSON. |
I suspect the CI is failing because of a bug in Fable Python trying to understand where |
Well ... member _.encodeList values = JS.Constructors.Array.from values
member _.encodeSeq values = JS.Constructors.Array.from values I feel like this place is a good place to start my investigation as seeing |
6604e92
to
afa6ac9
Compare
Change Encoder type to return IEncodable, deferring concrete representation of JSON.
Follows from the discussion here: #175 (comment)