1[package]
2name = "serde_json"
3version = "1.0.114"
4authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
5categories = ["encoding", "parser-implementations", "no-std"]
6description = "A JSON serialization file format"
7documentation = "https://docs.rs/serde_json"
8edition = "2021"
9keywords = ["json", "serde", "serialization"]
10license = "MIT OR Apache-2.0"
11repository = "https://github.com/serde-rs/json"
12rust-version = "1.56"
13
14[dependencies]
15indexmap = { version = "2.2.1", optional = true }
16itoa = "1.0"
17ryu = "1.0"
18serde = { version = "1.0.194", default-features = false }
19
20[dev-dependencies]
21automod = "1.0.11"
22indoc = "2.0.2"
23ref-cast = "1.0.18"
24rustversion = "1.0.13"
25serde = { version = "1.0.194", features = ["derive"] }
26serde_bytes = "0.11.10"
27serde_derive = "1.0.166"
28serde_stacker = "0.1.8"
29trybuild = { version = "1.0.81", features = ["diff"] }
30
31[lib]
32doc-scrape-examples = false
33
34[package.metadata.docs.rs]
35features = ["preserve_order", "raw_value", "unbounded_depth"]
36targets = ["x86_64-unknown-linux-gnu"]
37rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"]
38
39[package.metadata.playground]
40features = ["raw_value"]
41
42
43### FEATURES #################################################################
44
45[features]
46default = ["std"]
47
48std = ["serde/std"]
49
50# Provide integration for heap-allocated collections without depending on the
51# rest of the Rust standard library.
52# NOTE: Disabling both `std` *and* `alloc` features is not supported yet.
53alloc = ["serde/alloc"]
54
55# Make serde_json::Map use a representation which maintains insertion order.
56# This allows data to be read into a Value and written back to a JSON string
57# while preserving the order of map keys in the input.
58preserve_order = ["indexmap", "std"]
59
60# Use sufficient precision when parsing fixed precision floats from JSON to
61# ensure that they maintain accuracy when round-tripped through JSON. This comes
62# at an approximately 2x performance cost for parsing floats compared to the
63# default best-effort precision.
64#
65# Unlike arbitrary_precision, this feature makes f64 -> JSON -> f64 produce
66# output identical to the input.
67float_roundtrip = []
68
69# Use an arbitrary precision number representation for serde_json::Number. This
70# allows JSON numbers of arbitrary size/precision to be read into a Number and
71# written back to a JSON string without loss of precision.
72#
73# Unlike float_roundtrip, this feature makes JSON -> serde_json::Number -> JSON
74# produce output identical to the input.
75arbitrary_precision = []
76
77# Provide a RawValue type that can hold unprocessed JSON during deserialization.
78raw_value = []
79
80# Provide a method disable_recursion_limit to parse arbitrarily deep JSON
81# structures without any consideration for overflowing the stack. When using
82# this feature, you will want to provide some other way to protect against stack
83# overflows, such as by wrapping your Deserializer in the dynamically growing
84# stack adapter provided by the serde_stacker crate. Additionally you will need
85# to be careful around other recursive operations on the parsed result which may
86# overflow the stack after deserialization has completed, including, but not
87# limited to, Display and Debug and Drop impls.
88unbounded_depth = []
89