typed-openapi 0.0.2

Typed Rust calls and a clap command tree from one OpenAPI document, with every write behind a dry-run gate.
Documentation
[package]
name = "typed-openapi"
description = "Typed Rust calls and a clap command tree from one OpenAPI document, with every write behind a dry-run gate."
keywords = ["openapi", "clap", "cli", "codegen", "http"]
categories = [
    "command-line-interface",
    "api-bindings",
    "web-programming::http-client",
    "development-tools",
]
edition.workspace = true
rust-version.workspace = true
version.workspace = true
license.workspace = true
repository.workspace = true
authors.workspace = true

[features]
default = ["clap"]

# The command tree and the trip back from `ArgMatches` to a sent request: the
# `tree` module and nothing else. A crate that only wants typed calls turns it
# off and links no argument parser.
clap = ["dep:clap"]

# Reading an OpenAPI document: `Document::load`, `overlay::apply` and the
# `$ref` resolver behind them. A bless step turns it on. A binary that starts
# from `Document::from_blob` leaves it off, and then the YAML parser, the
# OpenAPI object model and the Overlay engine are not in what it compiles,
# links or audits.
document = ["dep:openapiv3", "dep:roas-overlay", "dep:serde_yaml_ng"]

# The generator: the `generate` module a bless step calls to write the typed
# wrappers, the Rust schema types and the reduced model. It reads a document,
# so it implies `document`, and it pulls typify and a syntax-tree printer
# behind it. Nothing a shipping binary enables.
generate = [
    "document",
    "dep:heck",
    "dep:prettyplease",
    "dep:proc-macro2",
    "dep:quote",
    "dep:schemars",
    "dep:syn",
    "dep:typify",
]

# `bon`'s builder on the generated wrappers, so a call with four arguments
# names them at the call site. Off by default: it puts two proc-macro crates
# in the graph of the crate that holds the generated code, and
# `docs/builders.md` measures what that costs.
builder = ["dep:bon"]

[dependencies]
bon = { workspace = true, optional = true }
clap = { workspace = true, optional = true }
heck = { workspace = true, optional = true }
http = { workspace = true }
openapiv3 = { workspace = true, optional = true }
postcard = { workspace = true }
prettyplease = { workspace = true, optional = true }
proc-macro2 = { workspace = true, optional = true }
quote = { workspace = true, optional = true }
regress = { workspace = true }
roas-overlay = { workspace = true, optional = true }
schemars = { workspace = true, optional = true }
serde = { workspace = true }
serde_json = { workspace = true }
serde_yaml_ng = { workspace = true, optional = true }
syn = { workspace = true, optional = true }
thiserror = { workspace = true }
typify = { workspace = true, optional = true }

[dev-dependencies]
# This crate's own tests read documents and generate from them. Depending on
# itself is how a test target turns a feature on without any library consumer
# inheriting it: a dev-dependency's features reach `cargo test` and
# `cargo clippy --all-targets` and stop there.
typed-openapi = { path = ".", features = ["document", "generate"] }

[package.metadata.docs.rs]
all-features = true

[lints]
workspace = true