[package]
authors = [
"Jonas Bushart",
"Marcin Kaźmierczak",
]
name = "serde_with"
categories = ["encoding", "no-std", "no-std::no-alloc"]
description = "Custom de/serialization functions for Rust's serde"
documentation = "https://docs.rs/serde_with/"
keywords = ["serde", "utilities", "serialization", "deserialization"]
edition.workspace = true
license.workspace = true
readme.workspace = true
repository.workspace = true
rust-version.workspace = true
version.workspace = true
include = ["src/**/*", "tests/**/*", "LICENSE-*", "README.md", "CHANGELOG.md"]
[badges]
maintenance = {status = "actively-developed"}
[features]
default = ["std", "macros"]
alloc = ["serde/alloc", "base64?/alloc", "chrono_0_4?/alloc", "hex?/alloc", "serde_json?/alloc", "time_0_3?/alloc"]
std = ["alloc", "serde/std", "chrono_0_4?/clock", "chrono_0_4?/std", "indexmap_1?/std", "indexmap_2?/std", "time_0_3?/serde-well-known", "time_0_3?/std"]
guide = ["dep:doc-comment", "dep:document-features", "macros", "std"]
base64 = ["dep:base64", "alloc"]
chrono = ["chrono_0_4"]
chrono_0_4 = ["dep:chrono_0_4"]
hashbrown_0_14 = ["dep:hashbrown_0_14", "alloc"]
hex = ["dep:hex", "alloc"]
indexmap = ["indexmap_1"]
indexmap_1 = ["dep:indexmap_1", "alloc"]
indexmap_2 = ["dep:indexmap_2", "alloc"]
json = ["dep:serde_json", "alloc"]
macros = ["dep:serde_with_macros"]
time_0_3 = ["dep:time_0_3"]
[dependencies]
base64 = {version = "0.21.0", optional = true, default-features = false}
chrono_0_4 = {package = "chrono", version = "0.4.20", optional = true, default-features = false, features = ["serde"]}
doc-comment = {version = "0.3.3", optional = true}
document-features = {version = "0.2.7", optional = true}
hashbrown_0_14 = {package = "hashbrown", version = "0.14.0", optional = true, default-features = false, features = ["serde"]}
hex = {version = "0.4.3", optional = true, default-features = false}
indexmap_1 = {package = "indexmap", version = "1.8", optional = true, default-features = false, features = ["serde-1"]}
indexmap_2 = {package = "indexmap", version = "2.0", optional = true, default-features = false, features = ["serde"]}
serde = {version = "1.0.152", default-features = false, features = ["derive"] }
serde_json = {version = "1.0.45", optional = true, default-features = false}
serde_with_macros = {path = "../serde_with_macros", version = "=3.4.0", optional = true}
time_0_3 = {package = "time", version = "~0.3.11", optional = true, default-features = false}
[dev-dependencies]
expect-test = "1.3.0"
fnv = "1.0.6"
glob = "0.3.0"
mime = "0.3.16"
pretty_assertions = "1.4.0"
regex = {version = "1.9.1", default-features = false, features = ["std"]}
rmp-serde = "1.1.0"
ron = "0.8"
rustversion = "1.0.0"
serde_json = {version = "1.0.25", features = ["preserve_order"]}
serde_test = "1.0.124"
serde_yaml = "0.9.2"
serde-xml-rs = "0.6.0"
version-sync = "0.9.1"
xml-rs = "=0.8.14"
[[test]]
name = "base64"
path = "tests/base64.rs"
required-features = ["base64", "macros"]
[[test]]
name = "chrono_0_4"
path = "tests/chrono_0_4.rs"
required-features = ["chrono_0_4", "macros"]
[[test]]
name = "hex"
path = "tests/hex.rs"
required-features = ["hex", "macros"]
[[test]]
name = "hashbrown_0_14"
path = "tests/hashbrown_0_14.rs"
required-features = ["hashbrown_0_14", "macros"]
[[test]]
name = "indexmap_1"
path = "tests/indexmap_1.rs"
required-features = ["indexmap_1", "macros"]
[[test]]
name = "indexmap_2"
path = "tests/indexmap_2.rs"
required-features = ["indexmap_2", "macros"]
[[test]]
name = "json"
path = "tests/json.rs"
required-features = ["json", "macros"]
[[test]]
name = "serde_as"
path = "tests/serde_as/lib.rs"
required-features = ["macros"]
[[test]]
name = "time_0_3"
path = "tests/time_0_3.rs"
required-features = ["macros", "time_0_3"]
[[test]]
name = "derives"
path = "tests/derives/lib.rs"
required-features = ["macros"]
[[test]]
name = "with_prefix"
path = "tests/with_prefix.rs"
required-features = ["macros"]
[[test]]
name = "rust"
path = "tests/rust.rs"
required-features = ["alloc"]
[package.metadata.docs.rs]
all-features = true
rustdoc-args = [
"--cfg=docsrs",
"-Zunstable-options", "--generate-link-to-definition"
]
[package.metadata.release]
pre-release-replacements = [
{file = "CHANGELOG.md", search = "\\[Unreleased\\]", replace = "[Unreleased]\n\n## [{{version}}] - {{date}}"},
{file = "src/lib.rs", search = "https://docs\\.rs/serde_with/[\\d.]+/", replace = "https://docs.rs/serde_with/{{version}}/"},
{file = "README.md", search = "https://docs\\.rs/serde_with/[\\d.]+/", replace = "https://docs.rs/serde_with/{{version}}/"},
]
tag = true
tag-message = "{{crate_name}} v{{version}}"
tag-name = "v{{version}}"