-
Notifications
You must be signed in to change notification settings - Fork 211
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
Update to Body consistency in http request #2945
Update to Body consistency in http request #2945
Conversation
All changed packages have been documented.
Show changes
|
You can try these changes at https://cadlplayground.z22.web.core.windows.net/prs/2945/ Check the website changes at https://tspwebsitepr.z22.web.core.windows.net/prs/2945/ |
packages/samples/test/output/documentation/@typespec/openapi3/openapi.yaml
Outdated
Show resolved
Hide resolved
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.
Just a minor nit
Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com>
Core PR microsoft/typespec#2945 Azure spec PR showing scale of breaking changes Azure/azure-rest-api-specs#27897
fix #2868
@body
to mean this is the body and nothing will be excluded(show warning on containing metadata)@bodyRoot
which has the same purpose as the old@body
( Allows changing where the body is resolved from but allows mixing with metadata.@bodyIgnore
which allows a property to be ignored from the bodyalso fix #2075
Examples from original issue
Breaking changes
Azure spec PR showing scale of breaking changes Azure/azure-rest-api-specs#27897
@body
means this is the bodyThis change makes it that using
@body
will mean exactly this is the body and everything underneath will be included, including metadata properties. It will log a warning explaining that.Solution use
@bodyRoot
as the goal is only to change where to resolve the body from.Empty model after removing metadata and visibility property result in void always
This means the following case have changed from returning
{}
to no bodyWorkaround: Use explicit
@body
Status code always 200 except if response is explicitly
void
Solution: Add explicit
@statusCode
Properties are not automatically omitted if everything was removed from metadata or visibility
Solution: use
@bodyIgnore