# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2024"
rust-version = "1.85"
name = "api-bones"
version = "4.6.0"
authors = ["Gregoire Salingue"]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Opinionated REST API types: errors (RFC 9457), pagination, health checks, and more"
homepage = "https://github.com/brefwiz/api-bones"
documentation = "https://docs.rs/api-bones"
readme = "README.md"
keywords = [
    "rest",
    "http",
    "rfc9457",
    "api",
    "axum",
]
categories = [
    "web-programming::http-server",
    "api-bindings",
    "no-std",
    "data-structures",
]
license = "MIT"
repository = "https://github.com/brefwiz/api-bones"
resolver = "2"

[features]
alloc = []
arbitrary = [
    "dep:arbitrary",
    "uuid?/arbitrary",
    "std",
]
auth = [
    "alloc",
    "base64",
    "dep:zeroize",
]
axum = [
    "dep:axum",
    "http",
    "serde",
    "std",
]
base64 = [
    "alloc",
    "dep:base64",
]
chrono = [
    "dep:chrono",
    "utoipa?/chrono",
]
default = [
    "std",
    "serde",
    "uuid",
    "chrono",
    "validator",
]
fake = [
    "dep:fake",
    "dep:rand",
    "std",
    "uuid",
]
hmac = [
    "base64",
    "alloc",
    "dep:hmac",
    "dep:sha2",
]
http = [
    "dep:http",
    "alloc",
]
icalendar = [
    "dep:icalendar",
    "std",
]
proptest = [
    "dep:proptest",
    "dep:proptest-derive",
    "std",
]
schemars = [
    "dep:schemars",
    "schemars/uuid1",
    "schemars/chrono04",
    "std",
]
serde = [
    "dep:serde",
    "dep:serde_json",
    "uuid?/serde",
    "chrono?/serde",
    "std",
]
std = [
    "alloc",
    "thiserror/std",
]
utoipa = [
    "dep:utoipa",
    "std",
]
uuid = ["dep:uuid"]
validator = [
    "dep:validator",
    "std",
]

[lib]
name = "api_bones"
path = "src/lib.rs"

[[example]]
name = "audit"
path = "examples/audit.rs"
required-features = [
    "uuid",
    "chrono",
]

[[example]]
name = "auth_flow"
path = "examples/auth_flow.rs"
required-features = ["auth"]

[[example]]
name = "axum_core_extractors"
path = "examples/axum_core_extractors.rs"
required-features = ["axum"]

[[example]]
name = "axum_error_handling"
path = "examples/axum_error_handling.rs"
required-features = ["axum"]

[[example]]
name = "axum_extractors_and_ratelimit"
path = "examples/axum_extractors_and_ratelimit.rs"
required-features = ["axum"]

[[example]]
name = "bulk_envelope"
path = "examples/bulk_envelope.rs"

[[example]]
name = "bulk_operations"
path = "examples/bulk_operations.rs"

[[example]]
name = "cache_control"
path = "examples/cache_control.rs"

[[example]]
name = "cursor_hmac"
path = "examples/cursor_hmac.rs"
required-features = ["base64"]

[[example]]
name = "error_construction"
path = "examples/error_construction.rs"
required-features = [
    "uuid",
    "std",
    "serde",
]

[[example]]
name = "error_handling"
path = "examples/error_handling.rs"
required-features = [
    "uuid",
    "std",
    "serde",
]

[[example]]
name = "etag"
path = "examples/etag.rs"

[[example]]
name = "etag_conditional"
path = "examples/etag_conditional.rs"

[[example]]
name = "hateoas_links"
path = "examples/hateoas_links.rs"

[[example]]
name = "header_parser"
path = "examples/header_parser.rs"
required-features = ["http"]

[[example]]
name = "health_check"
path = "examples/health_check.rs"

[[example]]
name = "org_context"
path = "examples/org_context.rs"
required-features = ["uuid"]

[[example]]
name = "pagination"
path = "examples/pagination.rs"

[[example]]
name = "problem_json"
path = "examples/problem_json.rs"
required-features = ["axum"]

[[example]]
name = "query_builder"
path = "examples/query_builder.rs"
required-features = ["serde"]

[[example]]
name = "query_params"
path = "examples/query_params.rs"

[[example]]
name = "range_headers"
path = "examples/range_headers.rs"

[[example]]
name = "rate_limit"
path = "examples/rate_limit.rs"

[[example]]
name = "response_envelope"
path = "examples/response_envelope.rs"
required-features = [
    "uuid",
    "serde",
]

[[example]]
name = "slug"
path = "examples/slug.rs"

[[example]]
name = "trace_context"
path = "examples/trace_context.rs"
required-features = ["uuid"]

[[test]]
name = "arbitrary_smoke"
path = "tests/arbitrary_smoke.rs"

[[test]]
name = "fake_smoke"
path = "tests/fake_smoke.rs"

[[test]]
name = "version_display"
path = "tests/version_display.rs"

[dependencies.arbitrary]
version = "1"
features = ["derive"]
optional = true

[dependencies.axum]
version = "0.8"
optional = true

[dependencies.base64]
version = "0.22"
features = ["alloc"]
optional = true
default-features = false

[dependencies.chrono]
version = "0.4"
optional = true

[dependencies.fake]
version = "5"
optional = true

[dependencies.hmac]
version = "0.13"
optional = true

[dependencies.http]
version = "1.0"
optional = true

[dependencies.icalendar]
version = "0.17"
features = [
    "parser",
    "serde",
]
optional = true

[dependencies.proptest]
version = "1"
optional = true

[dependencies.proptest-derive]
version = "0.8"
optional = true

[dependencies.rand]
version = "0.10"
optional = true

[dependencies.schemars]
version = "1"
optional = true

[dependencies.serde]
version = "1.0"
features = ["derive"]
optional = true

[dependencies.serde_json]
version = "1.0"
optional = true

[dependencies.sha2]
version = "0.11"
optional = true

[dependencies.thiserror]
version = "2"
default-features = false

[dependencies.utoipa]
version = "5"
features = [
    "uuid",
    "chrono",
]
optional = true

[dependencies.uuid]
version = "1.23"
features = ["v4"]
optional = true

[dependencies.validator]
version = "0.20"
features = ["derive"]
optional = true

[dependencies.zeroize]
version = "1"
features = ["derive"]
optional = true

[dev-dependencies.mockito]
version = "1.7.2"

[dev-dependencies.tokio]
version = "1"
features = [
    "macros",
    "rt",
    "rt-multi-thread",
    "net",
]

[lints.clippy]
derive_partial_eq_without_eq = "allow"
missing_const_for_fn = "allow"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
module_name_repetitions = "allow"
option_if_let_else = "allow"

[lints.clippy.all]
level = "deny"
priority = -1

[lints.clippy.nursery]
level = "warn"
priority = -1

[lints.clippy.pedantic]
level = "deny"
priority = -1

[lints.rust.dead_code]
level = "deny"
priority = -1

[lints.rust.unexpected_cfgs]
level = "allow"
priority = 0
check-cfg = ["cfg(coverage)"]

[lints.rust.unsafe_code]
level = "deny"
priority = -1

[lints.rust.unsafe_op_in_unsafe_fn]
level = "deny"
priority = -1

[lints.rust.unused_imports]
level = "deny"
priority = -1

[lints.rust.unused_variables]
level = "deny"
priority = -1

[lints.rust.warnings]
level = "deny"
priority = -1
