microsoft / microsoft/typespec
[python] add headers as properties to our DPG models
- Dominant language
- Java
- Stars
- 5.9k
- Forks
- 394
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 104
Description
transferred from https://github.com/Azure/autorest.python/issues/1991
Right now, a DPG response model only represents a response body. If TypeSpec defines a response model as including response headers as well (think `BlobProperties` in storage), we want to include that information in our DPG response model.
We've thought of a few ways of including this on our response model. For all of these ways we've decided not to include the header properties on the dictionary representation of the model, so the header properties will all be attribute only, and will not show up in dict-syntax.
1. Have header properties as top-level attributes, i.e. `my_model.my_header_attribute`
2. Have a `.headers` attribute on these models, i.e. `my_model.headers.my_header_attribute`
3. Have a `.get_headers()` attribute on these models, i.e. `my_model.get_headers().my_header_attribute`
Contributor guide
Assessment
This issue has not been assessed yet.