Skip to content
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

[TCGC][Bug] TCGC added content-type header should be optional if request body is optional #1259

Closed
Tracked by #2665 ...
haolingdong-msft opened this issue Jul 30, 2024 · 0 comments · Fixed by #1452
Closed
Tracked by #2665 ...
Assignees
Labels
lib:tcgc Issues for @azure-tools/typespec-client-generator-core library

Comments

@haolingdong-msft
Copy link
Member

haolingdong-msft commented Jul 30, 2024

Currently if the operation's request body is optional, TCGC will still add a required content-type header, this seems incorrect. Because for this case, we don't want to add content-type by default. It should be added when body is passed in. So we need to mark the content-type as optional.

image

@haolingdong-msft haolingdong-msft changed the title [TCGC][Bug] TCGC added content-type [TCGC][Bug] TCGC added content-type header should be optional if request body is optional Jul 30, 2024
@haolingdong-msft haolingdong-msft self-assigned this Jul 30, 2024
@lirenhe lirenhe added the lib:tcgc Issues for @azure-tools/typespec-client-generator-core library label Aug 12, 2024
markcowl pushed a commit to markcowl/typespec-azure that referenced this issue Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib:tcgc Issues for @azure-tools/typespec-client-generator-core library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants