Releases: gpu-cli/openapi-to-rust
Releases · gpu-cli/openapi-to-rust
v0.1.15
Two follow-ups to issue #7 that surfaced after 0.1.14:
anyOfwith{"type": "null"}and 3+ variants previously panicked with"()" is not a valid Identbecause the null branch produced a phantom()type alias.analyze_anyof_unionnow filters{"type": "null"}variants up front, mirroring theoneOffix.oneOfwith an array variant whose items reduce toserde_json::Value(e.g.items: {}) previously emittedVec<SerdeJsonValue>. The generator now emitsVec<serde_json::Value>(andVec<Vec<serde_json::Value>>) as path tokens instead of mangling the::into a single ident.
Fixes #7.
v0.1.14
Fix oneOf with {"type": "null"} variants (#7).
Previously, an inline oneOf: [{"type": "null"}, {"type": "string"}] schema generated an untagged enum with a phantom SerdeJsonValue(SerdeJsonValue) variant — a non-existent type produced by mangling serde_json::Value into a single ident. anyOf already handled the same shape correctly.
oneOf now matches anyOf:
oneOf: [Type, null]reduces to the non-null type with the property marked nullable (Option<T>).oneOfwith 3+ variants including{"type": "null"}filters the null branch out instead of leaking it through.- The generator emits
serde_json::Valueas a path defensively, so any future analyzer path that pushes it as a union variant target stays valid Rust.
Fixes #7.
v0.1.3
What's New
Bug Fixes (#2)
- Resolve
$refparameter references — Parameters defined via$refincomponents/parametersare now properly resolved before extraction - Merge path-item-level parameters — Parameters defined at the PathItem level are now inherited by all operations on that path (operation-level params take precedence per the OpenAPI spec)
- Fix
urlvariable name collision — Renamed internal URL construction variable torequest_urlto avoid shadowing when an operation has a parameter namedurl
Improvements (#3)
- Use raw identifiers for Rust keywords — Fields like
typenow generater#typeinstead oftype_, producing more idiomatic Rust code
New Features
- Operation registry generator — New
registry_generatorthat emits static operation metadata (method, path, params, body, response schema) for CLI/proxy routing use cases - Robust YAML/JSON parsing — Handle integers exceeding i64/u64 range, lossy JSON fallback for specs with large numbers
- 50+ real-world OpenAPI specs — Added specs from Stripe, GitHub, Cloudflare, OpenAI, and more with download script and batch test harness
Breaking Changes
- Generated field names for Rust keywords changed from
type_tor#type(affects consumers of generated code) Info.versionis nowOption<String>instead ofString