https://github.com/optum/legion-json
A JSON wrapper module for the LegionIO framework
https://github.com/optum/legion-json
json legionio ruby
Last synced: about 2 months ago
JSON representation
A JSON wrapper module for the LegionIO framework
- Host: GitHub
- URL: https://github.com/optum/legion-json
- Owner: Optum
- License: apache-2.0
- Created: 2021-06-01T22:10:50.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-05T15:47:00.000Z (about 5 years ago)
- Last Synced: 2025-03-08T13:36:54.438Z (over 1 year ago)
- Topics: json, legionio, ruby
- Language: Ruby
- Homepage:
- Size: 42 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
Legion::Json
=====
Legion::Json is the JSON wrapper that is used by the LegionIO framework. It gives all other gems and extensions a single
json library to use for consistency. It wraps [multi_json](https://rubygems.org/gems/multi_json) and also [json_pure](https://rubygems.org/gems/json_pure)
Additional C extension style json gems can be installed like [oj](https://rubygems.org/gems/oj) and it they should be
used automatically.
Supported Ruby versions and implementations
------------------------------------------------
Legion::Json should work identically on:
* JRuby 9.2+
* Ruby 2.4+
Installation and Usage
------------------------
You can verify your installation using this piece of code:
```bash
gem install legion-json
```
```ruby
require 'legion-json'
json_string = '{"foo":"bar","nested":{"hello":"world"}}'
Legion::Json.load(json_string)
Legion::Json.load(json_string, symbolize_keys: false) # symbolize_keys defaults to true
hash = {foo: 'bar', nested: {hello: 'world'}}
Legion::Json.dump(hash)
Legion::Json.dump(hash, )
```
Authors
----------
* [Matthew Iverson](https://github.com/Esity) - current maintainer