[package] name = "axum-codec" version = "0.0.14" edition = "2021" description = "A multi-codec extractor and response writer for Axum" license = "MIT OR Apache-2.0" authors = ["Matthew Polak "] repository = "https://github.com/matteopolak/axum-codec" [package.metadata.docs.rs] all-features = true [workspace] members = ["macros", ".", "examples/*"] [dependencies] aide = { version = "0.13", optional = true, default-features = false, features = ["axum"] } axum = { version = "0.7", default-features = false } axum-codec-macros = { path = "macros", version = "0.0.10", default-features = false } bincode = { version = "2.0.0-rc.3", default-features = false, features = ["std"], optional = true } # 0.6.3 added the #[bitcode(crate = "...")] option bitcode = { version = "0.6.3", default-features = false, features = ["std"], optional = true } ciborium = { version = "0.2", optional = true } mime = "0.3" rmp-serde = { version= "1", optional = true } schemars = { version = "0.8", optional = true, default-features = false } serde = { version = "1", optional = true, default-features = false } serde_json = { version = "1", optional = true } serde_yaml = { version = "0.9", optional = true } thiserror = "1" toml = { version = "0.8", optional = true } validator = { version = "0.18", optional = true } [dev-dependencies] axum = "0.7" serde = { version = "1", features = ["derive", "rc"] } tokio = { version = "1", features = ["macros", "rt-multi-thread"] } axum-codec = { path = ".", features = ["full-codecs", "macros"] } bitcode = "0.6" [features] default = ["json", "macros", "pretty-errors"] # Enables all codecs full-codecs = ["bincode", "bitcode", "cbor", "json", "msgpack", "toml", "yaml"] macros = ["schemars?/derive", "bincode?/derive", "bitcode?/derive", "serde?/derive", "validator?/derive", "axum-codec-macros/debug"] # Enables support for {get,put,..}_with and relevant chaning methods # to add documentation to routes aide = ["dep:aide", "dep:schemars", "axum-codec-macros/aide", "axum/json", "axum/form", "axum/original-uri", "axum/query", "axum/tokio", "axum/matched-path"] # Enables support for `validator`, adds an additional `validator::Validate` bound to `T` in `Codec` validator = ["dep:validator", "axum-codec-macros/validator"] # Enables more verbose (and expensive) error handling machinery, but significantly # improves the quality of error messages for consumers of the API. pretty-errors = ["macros"] bincode = ["dep:bincode", "axum-codec-macros/bincode"] bitcode = ["dep:bitcode", "axum-codec-macros/bitcode"] cbor = ["dep:ciborium", "serde"] json = ["dep:serde_json", "serde"] msgpack = ["dep:rmp-serde", "serde"] toml = ["dep:toml", "serde"] yaml = ["dep:serde_yaml", "serde"] # Should not be manually enabled, but will not cause any issues if it is. serde = ["dep:serde", "axum-codec-macros/serde"]