Skip to content
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

[DPG] Access to important response headers #32571

Open
annatisch opened this issue Oct 18, 2023 · 1 comment
Open

[DPG] Access to important response headers #32571

annatisch opened this issue Oct 18, 2023 · 1 comment
Assignees
Labels
DPG feature-request This issue requires a new behavior in the product in order be resolved.

Comments

@annatisch
Copy link
Member

Currently autorest generated methods only allow access to the response headers via either:

  • Passing in a raw_response_hook callable.
  • Passing in cls for custom deserialization (not documented nor advised that end customers use this).

It's therefore difficult to access headers that are an important part of the response.
For example, the "etag" returned from get_resource operation, as is the case for JobRouter SDK:
https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/communication/azure-communication-jobrouter/azure/communication/jobrouter/_operations/_operations.py#L1256

We need a design to make accessing this feel more integrated into the scenario.

@annatisch annatisch added the DPG label Oct 18, 2023
@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. Communication needs-team-triage Workflow: This issue needs the team to triage. labels Oct 18, 2023
@annatisch annatisch added feature-request This issue requires a new behavior in the product in order be resolved. and removed Client This issue points to a problem in the data-plane of the library. needs-team-triage Workflow: This issue needs the team to triage. Communication labels Oct 18, 2023
@lmazuel
Copy link
Member

lmazuel commented Oct 18, 2023

  • Have a response_header that returns the raw dict of the headers. This is all the time.
  • Expose as attribute at the root, named correctly, based on TypeSpec, if the model generation is on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DPG feature-request This issue requires a new behavior in the product in order be resolved.
Projects
None yet
Development

No branches or pull requests

2 participants