Skip to content

Chriscbr/jsurl-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsurl

A more compact and human-readable alternative to JSON + URL encoding.

crates.io Documentation Rust CI rustc 1.0+

Dependency Status Download Status

Usage

Add this to your Cargo.toml:

[dependencies]
jsurl = "0.1"

Description

This crate is a Rust implementation of the jsurl serialization format. It is a more compact and human-readable alternative to plain URL encoding for including JSON in URLs.

Example

use jsurl::{deserialize, serialize};
use serde_json::json;

let obj = json!({
    "name": "John Doe",
    "age": 42,
    "children": ["Mary", "Bill"]
});

let serialized = serialize(&obj);
assert_eq!(serialized, "~(name~'John*20Doe~age~42~children~(~'Mary~'Bill))");

let deserialized = deserialize("~(name~'John*20Doe~age~42~children~(~'Mary~'Bill))").unwrap();
assert_eq!(deserialized, obj);

License

Dual-licensed for compatibility with the Rust project.

Licensed under the Apache License Version 2.0: http://www.apache.org/licenses/LICENSE-2.0, or the MIT license: http://opensource.org/licenses/MIT, at your option.

About

A more compact and human-readable alternative to JSON + URL encoding

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages