microsoft / microsoft/typespec

Linter rule for http that check `Accept` header and response `content-type` are consistent

Open
#2,187 3 comments 0 reactions 0 assignees View on GitHub
lib:http
Dominant language
Java
Stars
5.9k
Forks
394
Avg merge
1d 23h
Merged PRs (30d)
104

Description

Now that we have the new linter system this seems like a good candidate

```tsp
op getPng(@header accept: "image/png"): {
@header contentType: "image/jpeg";
@body image: bytes;
};
```

[Example playground](https://cadlplayground.z22.web.core.windows.net/?c=aW1wb3J0ICJAdHlwZXNwZWMvaHR0cCI7Cgp1c2luZyBUeXBlU3BlYy5IdHRwOwoKb3AgZ2V0UG5nKEBoZWFkZXIgYWNjZXB0OiAiaW1hZ2UvcG5nIik6IHsKICDIImNvbnRlbnTES8knanBlZyI7xCVib2R5IMUVOiBieXRlczsKfTsK&e=%40typespec%2Fopenapi3&options=%7B%7D)

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.