-
Notifications
You must be signed in to change notification settings - Fork 161
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
Multipart explicit parts #3342
Multipart explicit parts #3342
Conversation
All changed packages have been documented.
Show changes
|
You can try these changes at https://cadlplayground.z22.web.core.windows.net/prs/3342/ Check the website changes at https://tspwebsitepr.z22.web.core.windows.net/prs/3342/ |
@timotheeguerin What are our plans for moving support for this into typespec-autorest? |
Need to make a follow up PR, though autorest support will be much more limited |
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.
A few questions. Also, is there an uptake PR for typespec-azure, and can we look at the impact on the azure-rest-api-specs repo before merging?
…ture/multipart-v2
I do not but this doesn't affect the existing implicit multipart (if it did it would be a bug) typespec autorest PR Azure/typespec-azure#902 |
…ture/multipart-v2
Add support for microsoft/typespec#3342 in autorest emitter
resolve #3046 Playground
Add the following:
@multipartBody
decoratorFile
typeHttpPart<Type, Options>
typeHad to do a decent amount of refactoring to be able to reuse the body parsing, this result in a much cleaner resolution of the body and other metadata properties across request, response and metadata.
The way it works now is instead of calling
gatherMetadata
that would just get the properties that are metadata but also ones with@body
and@bodyRoot
we now call aresolveHtpProperties
, this does the same resolution in term of filtering properties but it also figure out what is the kind of property in the concept of http(header, query, body, etc.) this leaves the error resolution to this function for duplicate annotations.What is nice is now we don't need to keep asking oh is this a query or a header or a body we can just check the kind of
HttpProperty
also resolve #1311