Skip to content

ohler55/oj

develop
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
August 16, 2023 19:01
June 2, 2023 20:55
lib
September 1, 2023 09:12
June 2, 2023 19:59
August 8, 2021 15:28
September 10, 2021 19:39
September 1, 2023 09:12
June 2, 2023 19:59
January 3, 2015 16:07
June 2, 2023 19:59
October 16, 2019 18:13
November 22, 2016 19:27
August 16, 2023 19:01

{}j gem

CI Gem Gem TideLift

A fast JSON parser and Object marshaller as a Ruby gem.

Version 3.13 is out with a much faster parser (Oj::Parser) and option isolation.

Using

require 'oj'

h = { 'one' => 1, 'array' => [ true, false ] }
json = Oj.dump(h)

# json =
# {
#   "one":1,
#   "array":[
#     true,
#     false
#   ]
# }

h2 = Oj.load(json)
puts "Same? #{h == h2}"
# true

Installation

gem install oj

or in Bundler:

gem 'oj'

Rails and json quickstart

See the Quickstart sections of the Rails and json docs.

multi_json

Code which uses multi_json will automatically prefer Oj if it is installed.

Support

Get supported Oj with a Tidelift Subscription. Security updates are supported.

Further Reading

For more details on options, modes, advanced features, and more follow these links.

Releases

See {file:CHANGELOG.md} and {file:RELEASE_NOTES.md}

Follow @peterohler on Twitter for announcements and news about the Oj gem.

Performance Comparisons

Contributing

  • Provide a Pull Request off the develop branch.
  • Report a bug
  • Suggest an idea
  • Code is now formatted with the clang-format tool with the configuration file in the root of the repo.