Infinities and NaNs get encoded as invalid JSON
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 338
- Forks
- 35
- Avg merge
- 13h 41m
- Merged PRs (30d)
- 3
Description
A Fleece value can legitimately be a floating-point infinity or NaN, since it just stores a binary IEEE format float/double.
However, there's no JSON encoding of such a value. Currently Fleece just uses sprintf, which writes something like Inf or NaN ... resulting in invalid JSON.
Instead, the best behavior is probably to fail (throw an exception / return an error) when encoding such a value.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test is named in the issue. Locate the JSON encoder and its sprintf-based floating-point path, then inspect how encoding errors are reported; done means infinity and NaN no longer produce invalid JSON and instead trigger the chosen error behavior, with coverage for both values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100