-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve request ID for custom header name #30771
Merged
Merged
Conversation
This file contains 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
Member
lmazuel
commented
Jun 14, 2023
- Add a kwarg to request id policy to set the header name (similar to what Java is already doing)
- Add requst id policy in config, for easier setting by codegen
lmazuel
requested review from
annatisch,
johanste,
xiangyan99,
tjprescott,
iscai-msft and
kashifkhan
as code owners
June 14, 2023 16:53
xiangyan99
approved these changes
Jun 14, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
API change check APIView has identified API level changes in this PR and created following API reviews. |
msyyc
approved these changes
Jun 15, 2023
kashifkhan
approved these changes
Jun 15, 2023
MaryGao
added a commit
to Azure/azure-sdk-for-js
that referenced
this pull request
Jul 12, 2023
…ines (#26424) ### Packages impacted by this PR @azure/core-rest-pipeline ### Issues associated with this PR Azure/autorest.typescript#1906 (comment) ### Describe the problem that is addressed by this PR Batch service has the requirement to custom their request id header to `client-request-id` ([tsp here](https://github.com/Azure/azure-rest-api-specs/blob/b37ad7f957f0c6f9dd149546e46399308f83b366/specification/batch/Batch/routes.tsp#L2719-L2727)). Currently the header name is fixed as default value `x-ms-client-request-id` in setClientRequestIdPolicy. So I think we could open an option in PipelineOptions to allow customizing this header. ### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen? Another option to support this is to add a customized policy from SDK side, to achieve that we could: - remove the default setClientRequestIdPolicy - re-add a new setClientRequestIdPolicy policy and set the header with customized name Compared to the latter one I think the current implementation would be more generic and elegant and can easily apply to more cases in future. But I'm also open for better options. ### References - Azure/azure-sdk-for-python#30771 --------- Co-authored-by: Jeff Fisher <xirzec@xirzec.com>
dgetu
pushed a commit
to Azure/azure-sdk-for-js
that referenced
this pull request
Sep 6, 2023
…ines (#26424) ### Packages impacted by this PR @azure/core-rest-pipeline ### Issues associated with this PR Azure/autorest.typescript#1906 (comment) ### Describe the problem that is addressed by this PR Batch service has the requirement to custom their request id header to `client-request-id` ([tsp here](https://github.com/Azure/azure-rest-api-specs/blob/b37ad7f957f0c6f9dd149546e46399308f83b366/specification/batch/Batch/routes.tsp#L2719-L2727)). Currently the header name is fixed as default value `x-ms-client-request-id` in setClientRequestIdPolicy. So I think we could open an option in PipelineOptions to allow customizing this header. ### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen? Another option to support this is to add a customized policy from SDK side, to achieve that we could: - remove the default setClientRequestIdPolicy - re-add a new setClientRequestIdPolicy policy and set the header with customized name Compared to the latter one I think the current implementation would be more generic and elegant and can easily apply to more cases in future. But I'm also open for better options. ### References - Azure/azure-sdk-for-python#30771 --------- Co-authored-by: Jeff Fisher <xirzec@xirzec.com>
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.