[package]
name = "reflectapi"
version = "0.17.2-alpha.2"
edition = "2021"

license = "Apache-2.0"
description = "ReflectAPI is a library for Rust code-first web service API declaration and corresponding clients code generation tools."
homepage = "https://github.com/thepartly/reflectapi"
documentation = "https://docs.rs/reflectapi"
repository = "https://github.com/thepartly/reflectapi"
readme = "README.md"

keywords = ["reflectapi", "codegen", "reflection", "restapi", "openapi"]
categories = ["web-programming", "development-tools", "api-bindings"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lints]
workspace = true

[dependencies]
# workspace dependencies
reflectapi-derive = { path = "../reflectapi-derive", version = "0.17.2-alpha.2" }
reflectapi-schema = { path = "../reflectapi-schema", version = "0.17.2-alpha.2" }

# mandatory 3rd party dependencies
serde = { version = "1.0.197", features = ["derive"] }
futures-util = "0.3"

# optional 3rd party dependencies for implementing schema builder
serde_json = { version = "1.0.114", optional = true }
bytes = { version = "1.5.0", optional = true }
http = { version = "1.1.0", optional = true }
mime = { version = "0.3.17", optional = true }

# optional 3rd party dependencies for additional serialization formats
rmp-serde = {version = "1.3.0", optional = true }

# optional 3rd party dependencies for implementing reflects traits for foreign types
uuid = { version = "1.7.0", optional = true, features = ["serde"] }
chrono = { version = "0.4.37", optional = true, features = ["serde"] }
chrono-tz = {  version = "0.10.4", optional = true, features = ["serde"]}
url = { version = "2.5.0", optional = true, features = ["serde"] }
rust_decimal = { version = "1.35.0", optional = true, features = ["serde"] }

# optional 3rd party dependencies for transforming reflect schema
# to runnable servers based on dififerent web server frameworks
axum = { version = "0.8.1", optional = true }

# optional 3rd party dependencies for enabling codegen
anyhow = { version = "1.0.81", optional = true }
indexmap = { version = "2.2.6", optional = true, features = ["serde"] }
check_keyword = { version = "0.2.0", optional = true }

# optional 3rd party dependencies for client runtime
reqwest = { version = "0.12", optional = true, features = ["stream"] }
reqwest-middleware = { version = "0.4", optional = true }
sseer = { version = "0.1", optional = true, features = ["json"] }

# optional dependency for documentation features
document-features = { version = "0.2", optional = true }

[dev-dependencies]
serde_json = { version = "1.0.114" }

[features]
default = ["glob"]
# feature for implementing schema builder
builder = ["dep:serde_json", "dep:bytes", "dep:http", "dep:mime"]
msgpack = ["dep:rmp-serde", "builder"]
# features for implementing reflect traits for foreign types
uuid = ["dep:uuid"]
chrono = ["dep:chrono"]
chrono-tz = ["dep:chrono-tz"]
url = ["dep:url"]
rust_decimal = ["dep:rust_decimal"]
# features for transforming reflect schema to runnable servers
# based on different web server frameworks
axum = ["dep:axum", "builder"]
# feature flag for enabling codegen libraries
codegen = [
    "dep:anyhow",
    "dep:indexmap",
    "dep:check_keyword",
    "dep:serde_json",
]
rt = ["dep:http", "dep:serde_json", "dep:bytes", "dep:url"]
glob = ["reflectapi-schema/glob"]
json = ["dep:serde_json"]
indexmap = ["dep:indexmap"]
reqwest = ["dep:reqwest"]
reqwest-middleware = ["dep:reqwest-middleware"]
rt-sse = ["dep:sseer", "rt"]
