Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Viewing all articles
Browse latest Browse all 4622

Parsing JSON without any conversions in Ruby

$
0
0

I am writing a Ruby script to migrate JSON files from one format to another. In this, I need to preserve the exact contents and formatting of all the values. Is there a JSON library in Ruby that will parse a file without any value validation or conversion, just leaving them as strings?

The default JSON library converts all numbers to Float, often losing precision. OJ can parse to BigDecimal, but then prints all the numbers in scientific notation. Neither lets me just skip convention altogether.


Viewing all articles
Browse latest Browse all 4622


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>