Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.
/ MonadicJSON Public archive

A JSONDecoder that correctly preserves the values of floating point numbers

Notifications You must be signed in to change notification settings

Qata/MonadicJSON

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MonadicJSON

!!! DEPRECATED !!!

The underlying issue was fixed circa iOS 17. The library is still functional, but there's no good reason to use it.

Original Description

The JSONDecoder supplied by Foundation is currently broken when it comes to isomorphic decoding of JSON numbers with fractional precision (what would be decoded to Float, Double and Decimal). You can read about the issue on the Swift bugtracker.

This project does not aim to be faster than the built-in JSONSerialization-based JSONDecoder, simply to be correct. Tests have shown a significant slowdown when using this decoder over the inbuilt one, so if you don't need absolute precision, do not use this decoder.

This project is not intended as a permanent replacement for JSONDecoder, but purely as a stopgap until SR-7054 is resolved.

About

A JSONDecoder that correctly preserves the values of floating point numbers

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages