Adds OpenAPISpec::from_yaml and OpenAPISpec::from_str alongside the existing from_json. from_str is JSON-first, YAML-fallback (ADR-051 §2): a valid JSON doc parses through serde_json (stricter grammar, immune to YAML-specific coercion); only on JSON failure does it fall back to the YAML parser. yaml_serde 0.10 (resolves to 0.10.4, latest stable) is the maintained official-YAML-org fork of the deprecated serde_yaml; not feature-gated per ADR-051 §3 (YAML OpenAPI is first-class). Note: ADR-051 §2's stated YAML 1.1 boolean-coercion rationale does not hold for yaml_serde 0.10 (YAML 1.2 core schema — yes/no/on/off are strings). The JSON-first rule is retained per the Accepted ADR as a defensive default; tests document the actual 0.10.x behavior with explicit comments. The ADR rationale should be amended separately. 256 tests pass; clippy + fmt clean.
51 lines
1.5 KiB
TOML
51 lines
1.5 KiB
TOML
[package]
|
|
name = "alknet-http"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
description = "HTTP interface for alknet: serves HTTP/1.1 + HTTP/2 on standard ALPNs (with WebSocket upgrade for browser bidirectional access) and hosts the HTTP-backed call-protocol adapters"
|
|
repository.workspace = true
|
|
|
|
[lib]
|
|
name = "alknet_http"
|
|
|
|
[features]
|
|
default = ["h2", "http1"]
|
|
mcp = ["dep:rmcp"]
|
|
h2 = ["dep:hyper", "hyper-util/http2", "hyper/http2"]
|
|
http1 = ["dep:hyper", "hyper-util/http1", "hyper/http1"]
|
|
|
|
[dependencies]
|
|
alknet-core = { path = "../alknet-core" }
|
|
alknet-call = { path = "../alknet-call" }
|
|
arc-swap = "1"
|
|
axum = { version = "0.8", features = ["ws"] }
|
|
hyper = { version = "1", optional = true, features = ["server"] }
|
|
hyper-util = { version = "0.1", features = ["server", "service", "tokio"] }
|
|
httpdate = "1"
|
|
reqwest = { version = "0.13", default-features = false, features = ["json", "stream", "rustls"] }
|
|
reqwest-middleware = "0.5"
|
|
reqwest-retry = "0.9"
|
|
tokio = { version = "1", features = ["full"] }
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
yaml_serde = "0.10"
|
|
async-trait = "0.1"
|
|
tracing = "0.1"
|
|
thiserror = "2"
|
|
uuid = { version = "1", features = ["v4"] }
|
|
futures = "0.3"
|
|
openapiv3 = "2"
|
|
http = "1"
|
|
url = "2"
|
|
rmcp = { version = "1.8", optional = true, default-features = false, features = [
|
|
"client",
|
|
"server",
|
|
"transport-streamable-http-client-reqwest",
|
|
"transport-streamable-http-server",
|
|
] }
|
|
|
|
[dev-dependencies]
|
|
http-body-util = "0.1"
|
|
tower = { version = "0.5", features = ["util"] }
|