Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Implementation of RFC 6901 which defines a string syntax for identifying a specific value within a JSON document

License

NotificationsYou must be signed in to change notification settings

xavier/json_pointer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An implementation ofRFC 6901 which defines a string syntax for identifying a specific value within a JSON document.

Installation

Add a dependency to your projectmix.exs:

defdepsdo[{:json_pointer,"~> 0.1.0"}]end

Usage

document=%{"key"=>"value","list"=>[1,2,3],"deeply"=>%{"nested"=>%{"values"=>[%{"x"=>1},%{"x"=>2}]}}}JSONPointer.resolve(document,"/key")# => {:ok, "value"}JSONPointer.resolve(document,"/list/1")# => {:ok, 2}JSONPointer.resolve(document,"/deeply/nested/values/0")# => {:ok, %{"x" => 1}}JSONPointer.resolve(document,"/deeply/nested/values/1/x")# => {:ok, 2}JSONPointer.resolve(document,"/list/4")# => {:error, "index 4 out of bounds in [1, 2, 3]"}

Dependencies

This library works with deserialized documents and does not include a JSON parser.

Contributors

In order of appearance:

About

Implementation of RFC 6901 which defines a string syntax for identifying a specific value within a JSON document

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp