[package]
name = "optionable"
version = "0.2.0"
edition = "2024"
description = "Derive macro (and associated marker trait) to derive nested structs/enums with all subfields being optional (e.g. for patches or Kubernetes server side apply)."
repository = "https://github.com/ngergs/optionable"
license = "MIT OR Apache-2.0"
readme = "README.md"

[features]
default = ["derive", "std"]
alloc = []
std = []
derive = ["dep:optionable_derive"]
chrono = ["dep:chrono"]
serde_json = ["dep:serde_json"]

[lints.clippy]
pedantic = "warn"

[dependencies]
optionable_derive = { version = "0.2.0", optional = true }
chrono = { version = "0.4.42", default-features = false, optional = true }
serde_json = { version = "1.0.145", default-features = false, optional = true }

[dev-dependencies]
serde = { version = "1.0.225", default-features = false, features = ["derive"] }
serde_json = { version = "1.0.145", default-features = false, features = ["std"] }

[package.metadata.docs.rs]
# to be able to document feature dependent settings, see https://users.rust-lang.org/t/how-to-document-optional-features-in-api-docs/64577/3
rustdoc-args = ["--cfg", "docsrs"]
# std needed for serde_json
# todo: only set serde_json/std here and use all-features=true once chrono has a release that does not use doc_auto_cfg anymore
features = ["derive", "std", "serde_json", "serde_json/std"]
all-features = false
