You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Have header properties as top-level attributes, i.e. my_model.my_header_attribute
Have a .headers attribute on these models, i.e. my_model.headers.my_header_attribute
Have a .get_headers() attribute on these models, i.e. my_model.get_headers().my_header_attribute
The text was updated successfully, but these errors were encountered:
For all of these ways we've decided not to include the header properties on the dictionary representation of the model
-> I am curious why we don't include header properties on the dictionary representation
Logically speaking the dictionary representation is reserved for just the body. The main reason for maintaining this is it would be a large logical shift if we had the dictionary representation include headers as well. For example: as the dictionary response is just a body, users can immediately pass in the returned dictionary in our model-less generations as body input to another operation. If we include header in the dictionary response, then we are opening users up to service errors / weird behavior. If we only include headers in attribute syntax, we can filter those out before sending to the service.
For all of these ways we've decided not to include the header properties on the dictionary representation of the model -> I am curious why we don't include header properties on the dictionary representation
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.
my_model.my_header_attribute
.headers
attribute on these models, i.e.my_model.headers.my_header_attribute
.get_headers()
attribute on these models, i.e.my_model.get_headers().my_header_attribute
The text was updated successfully, but these errors were encountered: