fix(http-client-python): correct etag slot assignment for custom etag-typed headers#10494
Open
iscai-msft wants to merge 3 commits intomicrosoft:mainfrom
Open
fix(http-client-python): correct etag slot assignment for custom etag-typed headers#10494iscai-msft wants to merge 3 commits intomicrosoft:mainfrom
iscai-msft wants to merge 3 commits intomicrosoft:mainfrom
Conversation
Custom conditional headers typed as Azure.Core.eTag (e.g. x-ms-if-blob-match) now get the same etag/match_condition parameter conversion as standard If-Match/If-None-Match headers. Changes: - Emitter: add isEtag flag to header parameters by checking raw TypeSpec type for Azure.Core.eTag scalar - Preprocess: use isEtag flag to apply etag/match_condition conversion for custom conditional headers; preserve original wire name so the serializer uses the correct HTTP header - Parameter model: read originalWireName from YAML - Serializer: use original wire name for HTTP header instead of hardcoded If-Match/If-None-Match Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…aders - Add _etag_kind() helper to classify etag headers up front using 'none-match' substring (stricter than 'none') before slot assignment - Use _etag_kind() for both slot pairing and per-parameter conversion, ensuring custom etag headers go to the correct if-match/if-none-match slot - Strip isEtag from synthetic partner params to prevent them from being re-converted with the wrong originalWireName - Fall back to standard If-Match/If-None-Match wire names for synthetic partners since the custom header family name can't be derived Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
commit: |
Contributor
|
All changed packages have been documented.
Show changes
|
Collaborator
|
You can try these changes here
|
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.
Problem
Custom etag-typed headers (e.g.
x-ms-if-blob-match,x-ms-if-blob-none-match) were being assigned to the wrong if-match/if-none-match slot during preprocessing. The slot assignment and the per-parameter conversion used different logic to classify headers, and synthetic partners inherited incorrect wire names.Changes
_etag_kind()helper — centralizes etag classification usingnone-matchsubstring (stricter than the previousnonecheck which could false-positive on unrelated headers)_etag_kind()to correctly classify custom etag headers before pairingisEtagfrom synthetic clones to prevent re-conversion with wrongoriginalWireName, falls back to standardIf-Match/If-None-Matchwire names_etag_kind()logic