Open msyyc opened 1 week ago
In design https://github.com/microsoft/typespec/issues/3046, Typespec permit users define explicit body in HttpPart<> like:
HttpPart<>
model Address { city: string; country: string; } op upload( @header `content-type`: "multipart/form-data"; @multipartBody body: { // # String body address: HttpPart<@body body: Address; @header MyHeader: string>, } ): void;
Shall we permit implicit body in HttpPart<> like:
op upload( @header `content-type`: "multipart/form-data"; @multipartBody body: { // # String body address: HttpPart<city: string; country: string; @header MyHeader: string>, } ): void;
?
PS: I try implicit body in playground. Although compiler doesn't report error, the generated swagger obviously is not right.
cc @bterlson
I believe so, if you look at openapi3 emitter it is emitted correctly playground
actually so is autorest swagger 2.0 doesn't support json parts so it just treat them as string. So just missing a warning I think
In design https://github.com/microsoft/typespec/issues/3046, Typespec permit users define explicit body in
HttpPart<>
like:Shall we permit implicit body in
HttpPart<>
like:?
PS: I try implicit body in playground. Although compiler doesn't report error, the generated swagger obviously is not right.
cc @bterlson