Skip to content

impatienttraveller/json-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

json-tools

Built with Crystal Build Status Releases

An implementation of RFC-6901 and RFC-6902

Installation

Add this to your application's shard.yml:

dependencies:
  json-tools:
    github: impatienttraveller/json-tools

Usage

require "json-tools"

Once you have a JSON::Any object in memory you can address any value using the Pointer class:

json : JSON::Any = ...
val = Json::Tools::Pointer.new("/foo/0/bar").eval(json)

JSON object can be patched by using the Patch class:

patch : JSON::Any = ...
json : JSON::Any = ...
patched_json = Json::Tools::Patch.new(patch).apply(json)

This creates a copy of the passed JSON object to work with and the original object is not altered.

Development

Please raise a GitHub issue and document the commit with the following format:

[issue-x] Description

Contributing

  1. Fork it (https://github.com/impatienttraveller/json-tools/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • ddcprg Daniel del Castillo - creator, maintainer

About

An implementation of RFC-6901 and RFC-6902 in Crystal Lang

Resources

License

Stars

Watchers

Forks

Packages

No packages published