[package]
name = "facet-json"
version = "0.32.3"
edition = "2024"
license = "MIT OR Apache-2.0"
rust-version = "1.89.0"
repository = "https://github.com/facet-rs/facet-json"
description = "JSON serialization and deserialization for Facet types"
keywords = ["json", "serialization", "deserialization", "reflection", "facet"]
categories = ["encoding", "parser-implementations"]
homepage = "https://facet.rs"

[package.metadata.docs.rs]
rustdoc-args = ["--html-in-header", "arborium-header.html"]

[package.metadata."docs.rs"]
rustdoc-args = ["--html-in-header", "arborium-header.html"]

[features]
std = ["alloc", "facet-core/std", "facet-reflect/std"]
alloc = ["facet-core/alloc", "facet-reflect/alloc"]
default = ["std"]
axum = ["std", "dep:axum-core", "dep:bytes", "dep:http", "dep:http-body-util", "dep:mime"]
tokio = ["std", "dep:tokio", "streaming"]
futures-io = ["std", "dep:futures-io", "streaming"]
streaming = ["std", "dep:corosensei"]
bolero-inline-tests = ["std"]
# JIT-compiled JSON deserialization using Cranelift
cranelift = ["std", "dep:cranelift", "dep:cranelift-jit", "dep:cranelift-module", "dep:cranelift-native", "dep:parking_lot", "dep:memchr"]
# Alias used by tooling/scripts that expect `--features jit`
jit = ["cranelift"]
# CI feature: enables cranelift for comprehensive testing
ci = ["cranelift"]

[dependencies]

# Axum integration (optional)
axum-core = { version = "0.5", default-features = false, optional = true }

# Profiling binary (optional)
brotli = { version = "7", optional = true }
bytes = { version = "1", default-features = false, optional = true }

# Stackful coroutines for streaming deserialization
corosensei = { version = "0.3", optional = true }

# JIT compilation dependencies (optional)
cranelift = { version = "0.126", optional = true }
cranelift-jit = { version = "0.126", optional = true }
cranelift-module = { version = "0.126", optional = true }
cranelift-native = { version = "0.126", optional = true }
facet = { path = "../facet", version = "0.32.3", default-features = false }
facet-core = { path = "../facet-core", version = "0.32.3", default-features = false, features = ["auto-traits", "bytes", "camino", "chrono", "fn-ptr", "indexmap", "jiff02", "net", "nonzero", "num-complex", "ordered-float", "ruint", "simd", "time", "tuples-12", "ulid", "url", "uuid"] }
facet-reflect = { path = "../facet-reflect", version = "0.32.3", default-features = false, features = ["miette"] }
facet-solver = { path = "../facet-solver", version = "0.32.3" }

# Futures-io integration (optional) - for smol, async-std, etc.
futures-io = { version = "0.3", optional = true }
http = { workspace = true, optional = true } #unified
http-body-util = { version = "0.1", default-features = false, optional = true }
itoa = "1.0.15"
lexical-parse-float = "1.0.5"
lexical-parse-integer = "1.0.5"
log = { workspace = true } #unified
memchr = { version = "2.7", optional = true }
miette = { workspace = true, features = ["derive", "fancy-no-backtrace"] } #unified
mime = { version = "0.3", default-features = false, optional = true }
parking_lot = { version = "0.12", optional = true }
ryu = "1"
strsim = { workspace = true } #unified

# Tokio integration (optional)
tokio = { version = "1", default-features = false, optional = true, features = ["io-util"] }

[[bench]]
name = "unified_benchmarks_divan"
harness = false

[[bench]]
name = "unified_benchmarks_gungraun"
harness = false


[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(feature, values(\"jiff\"))"] }
