Cargo Features

[dependencies]
axum-codec = { version = "0.0.17", default-features = false, features = ["full-codecs", "macros", "aide", "validator", "pretty-errors", "form", "bincode", "bitcode", "json", "msgpack", "toml", "yaml", "serde", "ciborium"] }
default = json, macros, pretty-errors

These default features are set whenever axum-codec is added without default-features = false somewhere in the dependency tree.

full-codecs = bincode, bitcode, form, json, msgpack, toml, yaml

Enables all codecs

macros default pretty-errors

Enables debug of axum-codec-macros and derive of optional bincode, optional bitcode, optional schemars, optional serde, and optional validator ^0.19

bitcode:

0.6.3 added the #[bitcode(crate = "...")] option

aide

Enables support for {get,put,..}_with and relevant chaning methods to add documentation to routes

Enables aide ^0.13, schemars, form, json, matched-path, original-uri, query and tokio of axum ^0.7, aide of axum-codec-macros

Affects handler::Input, response::IntoCodecResponse

validator

Enables support for validator, adds an additional validator::Validate bound to T in Codec<T>

Enables validator ^0.19, validator of axum-codec-macros

pretty-errors default = macros

Enables more verbose (and expensive) error handling machinery, but significantly improves the quality of error messages for consumers of the API.

Affects rejection::Message

form full-codecs?

Enables serde_urlencoded, form of axum ^0.7

bincode full-codecs?

Enables bincode, bincode of axum-codec-macros

bitcode full-codecs?

Enables bitcode, bitcode of axum-codec-macros

json default full-codecs? = serde

Enables serde_json

msgpack full-codecs? = serde

Enables rmp-serde

toml full-codecs? = serde

Enables toml

yaml full-codecs? = serde

Enables serde_yaml

serde json msgpack? toml? yaml?

Should not be manually enabled, but will not cause any issues if it is.

Enables serde, serde of axum-codec-macros

Features from optional dependencies

ciborium implicit feature

Enables ciborium

ciborium:

serde implementation of CBOR using ciborium-basic