Skip to content

tapsters/yaws-json2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

yaws-json2

yaws-json2 is encoder/decoder taked from Yaws webserver.

Installing

In rebar.config:

{yaws_json2, ".*", {git, "git://github.com/myua/yaws-json2", {tag, "master"}}}

Usage

Use yaws_json2:decode_string/1 to decode json. Example of input json:

{
  first_name: "John",
  last_name: "Smith",
  enabled: true,
  phone_number: 937600131,
  avatar: {
    origin: "default.png",
    thumbnails: [
      "default_min.png"
    ]
  }
}

Output:

{ok, {struct, [
  {"first_name", "John"},
  {"last_name", "Smith"},
  {"enabled", true},
  {"phone_number", 937600131},
  {"avatar", {struct, [
    {"origin", "default.png"},
    {"thumbnails", {array, [
      "default_min.png"
    ]}}
  ]}}
]}}

And also use yaws_json2:encode/1 to encode json.

About

Yaws json2 library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages