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
Using a custom type (tested: both model and enum) in a route that sets its content-type header to multipart/form-data appears to jealously guard against any other route using that type -- an attempt to do so results in
error @typespec/openapi/duplicate-type-name: Duplicate type name: 'MyModel'. Check @friendlyName decorators and overlap with types in TypeSpec or service namespace.
Omitting overridden use of content-type or setting to another value like text/plain or application/octet-stream doesn't encounter the issue, so it appears unique to multipart/form-data.
@getlistMyThings(input: MyRequestModel): string;
@postuploadMyThings(// OK if next line commented out or using another type like text/plain
@headercontentType: "multipart/form-data";
input: MyRequestModel): string;
Thanks!
The text was updated successfully, but these errors were encountered:
…used in multipart implicit body and json body. (#2752)
fix#2751
Problem was when we reduce the context it is a patch not a replace so if
we delete the contentType to have the default handling then it would
keep the previous value instead of actually removing it.
[TypeSpec playground link to repro]
Using a custom type (tested: both
model
andenum
) in a route that sets itscontent-type
header tomultipart/form-data
appears to jealously guard against any other route using that type -- an attempt to do so results inOmitting overridden use of
content-type
or setting to another value liketext/plain
orapplication/octet-stream
doesn't encounter the issue, so it appears unique tomultipart/form-data
.Thanks!
The text was updated successfully, but these errors were encountered: