Why introduce @multipartBody
decorator instead of relying only on @body
?
#8072
artsiommiksiuk
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
From docs (https://typespec.io/docs/libraries/http/multipart/):
Why having separate @multipartBody, and additionally HttpPart for that? Wouldn't this work?
content-type=form-data should be enough to just treat the same body differently, and HttpPart as a type I think is unnecessary, as you'd be splitting body per root field. You don't have a default fields combination logic anyway. If you want to modify content type of a part it probably should be decorator as a wire specific details, not domain relevant + encodedName to override the serialized name.
All of this reusing existing parts instead of adding new, keeping it leaner.
Or I'm missing something?
Beta Was this translation helpful? Give feedback.
All reactions