Repository navigation
Conversation
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.
Fixes #1462.
An operation can declare both a JSON
200and a bodyless304. The generated client currently reports the latter asUnexpectedResponse. This adds an opt-in for callers that want to revalidate a cached representation.When enabled, the generator emits the enum only for SDKs with an explicitly declared, bodyless
304.Modifiedcarries the existingResponseValue<T>.NotModifiedcarries the original HTTP response, preserving status and headers without deserializing a body. Both request styles support it. The build-script setting iswith_conditional_responses(true)and the standalone generator accepts--conditional-responses.The opt-in keeps existing generated signatures compatible. An item stream surfaces a
304with its original headers as an error because advancing the stream requires the items and next-page token from the cached page. The generated CLI sends single-request304s to its existingsuccess_no_itemcallback.The regression tests exercise an ETag round trip, a stale validator, a declared
404, an invalid200payload, the opt-in and declaration boundaries, and a304on a subsequent page in both SDK styles.AI disclosure
OpenAI Codex implemented the generator changes, wrote and ran the regression tests, and drafted this pull request description.