Skip to content

[python][bug] @clientName affects wireName of http payload body when content-type is "multipart/form-data" #9137

@msyyc

Description

@msyyc

Reported in python support channel:

Expected Behavior
@clientName should only affect the SDK's client-facing API. Wire serialization should use the original TypeSpec field name.

Actual Behavior
When @clientName is applied to an HttpPart field, the emitter uses the client name for the Content-Disposition header in the multipart request, causing the service to reject the field name.

TypeSpec Definition:
model TranscriptionContent {
@clientName("options") // Client API should use "options"
definition: HttpPart; // Wire should use "definition"
audio?: HttpPart;
}

Content-Type: multipart/form-data; boundary=...

Incorrect Wire Format
--boundary
Content-Disposition: form-data; name="options" ❌ Should be "definition"
Content-Type: application/json

{"audioUrl": "..."}

Current workround: I remove @clientName decorator entirely, forcing client code to use the wire name.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingemitter:client:pythonIssue for the Python client emitter: @typespec/http-client-python

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions