Generate typed HTTP error responses#135
Merged
Merged
Conversation
ad86390 to
50605a2
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
- Return or throw operation-specific errors for documented non-2xx responses - Preserve status, headers, raw bodies, and lazy typed error-body decoding - Regenerate cross-language goldens and add typed HTTP error runtime tests
50605a2 to
a58a129
Compare
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
Why
Generated clients previously surfaced documented 4xx/5xx responses through the normal success path. That made an HTTP failure look like a successful operation result and allowed callers to accidentally treat failed creates as success. This changes generated semantics so normal returns mean HTTP success only.
Validation
cargo test --workspace --all-targets --quietcargo test --test typed_http_error_runtime -- --nocapturecargo test --test jvm_http_error_runtime -- --nocapturecargo test --test multipart_runtime_smoke -- --nocaptureUPDATE_GOLDEN=1 cargo test --test golden_tests_java_okhttpUPDATE_GOLDEN=1 cargo test --test golden_tests_typescript_fetchcargo fmt --all -- --checkgit diff HEAD^ --check