Repository navigation
fix: preserve nested nullable schema semantics - #158
Merged
adamcavendish merged 2 commits intoOct 19, 2026
Merged
Conversation
- Retain container, item, and map-value nullability across OpenAPI 3.0, 3.1, and 3.2 lowering, including promoted items and nullable array aliases. - Render TypeScript nullable arrays with semantic unions that preserve precedence and named-type imports. - Pin all nine generators with nested nullable goldens and verify Rust HTTP decoding preserves strict controls, error metadata, and original bodies.
- Replace the recursive Cargo harness with standalone consumer projects for reqwest, ureq, and aioduct while preserving existing runtime assertions. - Generate unmodified client dependencies through the public CLI and run each backend's ordinary test files with checked-in manifests and lockfiles. - Keep client builds out of generator tests and coverage, and run them in an explicit CI matrix with reusable build caches and inherited warning flags.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
adamcavendish
deleted the
adamcavendish/preserve-nested-nullable-schemas
branch
October 19, 2026 11:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Preserve nested nullability across OpenAPI 3.0, 3.1, and 3.2, with output coverage for all nine generators and real HTTP decoding coverage for all three Rust backends.
Rust generated-client tests now live in standalone consumer projects. They use ordinary Rust test files and unmodified generated path dependencies, rather than having generator tests assemble test programs and recursively invoke Cargo.
Problem
Nested lowering could lose nullability from map values, array items, promoted inline items, and array aliases. OpenAPI 3.1/3.2 named maps also bypassed the supported nullable
oneOf/anyOfpattern. TypeScript nullable multidimensional arrays could produce invalidreadonly readonly string[][]syntax, and nullable element unions needed parentheses.The previous Rust runtime harness mixed generator testing with client build orchestration, rebuilt temporary crates per test, and injected an unused server helper that failed under CI's
-Dwarnings. The entire Rust harness is migrated here, not just the newly added nullable cases.Behavior
Map(Nullable(T)), distinct from a nullable containerArray(Nullable(T)), distinct from a nullable containerNullable(Array(T)), including aliases and promoted itemsTest organization
tests/generated-clients/rust/{reqwest,ureq,aioduct}are independent Cargo projects with checked-in manifests, lockfiles, and test source.just golden-rust::prepare <backend>generates the three fixtures through the public CLI into ignored, disposable directories. Generated manifests and source are not patched.just golden-rust::testruns one Cargo test invocation per backend, with persistent target directories. Tests contain no subprocess orchestration or dynamically assembled test programs.Boundaries
Shared schema semantics are fixed in lowering, not Rust-specific workarounds. Requiredness remains independent of nullability, and strict controls remain strict. Existing unspecified-type fallbacks and unrelated enum, union, and reference policies are unchanged.
No release-version or production dependency changes. The new consumer projects declare and lock their own test dependencies. Existing golden files are unchanged; the new nullable fixture adds output for every registered generator.