Skip to content

Conform floating points to JSONEncodable & JSONDecodable#92

Closed
rgoldberg wants to merge 2 commits intorarestype:masterfrom
rgoldberg:91-JSONEncodable-floating-points
Closed

Conform floating points to JSONEncodable & JSONDecodable#92
rgoldberg wants to merge 2 commits intorarestype:masterfrom
rgoldberg:91-JSONEncodable-floating-points

Conversation

@rgoldberg
Copy link
Contributor

@rgoldberg rgoldberg commented Oct 21, 2025

Conform floating points to JSONEncodable.

Resolve #91

@rgoldberg
Copy link
Contributor Author

@tayloraswift Need I make any changes to get this PR approved? Thanks.

@tayloraswift
Copy link
Member

i am concerned about adding a type that is Encode-only, and cannot be losslessly roundtripped

@rgoldberg
Copy link
Contributor Author

rgoldberg commented Nov 7, 2025

If I also conformed floating points to JSONDecodable, would you accept it?

Or would the limitations of acceptable values for Swift floating points prevent you from accepting it?

@rgoldberg rgoldberg force-pushed the 91-JSONEncodable-floating-points branch from a5f7669 to ad67fe5 Compare December 29, 2025 11:20
@rgoldberg rgoldberg changed the title Conform floating points to JSONEncodable Conform floating points to JSONEncodable & JSONDecodable Dec 29, 2025
@rgoldberg
Copy link
Contributor Author

@tayloraswift I've redone how floating points are conformed to JSONEncodable; I've also conformed them to JSONDecodable. Is that sufficient?

…unds from `BinaryInteger` to `Numeric & CustomStringConvertible` for `JSON.Literal where Value:` & `JSONEncodable where Self:`.

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>

Support floating point encoding by changing extension generic type bounds from `BinaryInteger` to `Numeric & CustomStringConvertible` for `JSON.Literal where Value:` & `JSONEncodable where Self:`.

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
@rgoldberg rgoldberg force-pushed the 91-JSONEncodable-floating-points branch from c6c930e to 76a8b9d Compare January 19, 2026 07:13
@tayloraswift
Copy link
Member

i used this as a starting point for #98 , which implements the underlying feature

thank you for pushing for this!

@rgoldberg rgoldberg deleted the 91-JSONEncodable-floating-points branch March 17, 2026 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Conform floating points to JSONEncodable.

2 participants