microsoft / microsoft/typespec

validate content-type set as constant/required while @body or @bodyRoot value is optional?

Open
#11,413 2 comments 2 reactions 2 assignees Claimed by @markcowl View on GitHub
feature lib:http triaged:core
Dominant language
Java
Stars
5.9k
Forks
394
Avg merge
1d 23h
Merged PRs (30d)
104

Description

if the spec contains the following for an operation:

```
model Bar {
baz: string;
}

op foo(
@doc("Type of content")
@header("content-type")
contentType: "application/json; odata=minimalmetadata";

@doc("The body.")
@body
body?: Bar;
): void;
```

Do we allow content-type to be required if the body is not or should we validate this?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.