microsoft / microsoft/typespec

Should a enum be allowed for the value of the content type header

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

Description

```
op test(@header contentType: ImagesContentTypes, @body body: bytes): void;

enum ImagesContentTypes {
`image/png`,
`image/jpeg`,
}

```

Right now we report an error for this.
[Playground Link](https://cadlplayground.z22.web.core.windows.net/?c=aW1wb3J0ICJAdHlwZXNwZWMvaHR0cCI7Cgp1c2luZyBUeXBlU3BlYy5IdHRwOwoKb3AgdGVzdChAaGVhZGVyIGNvbnRlbnTEJzogSW1hZ2VzQ8oTcywgQGJvZHkgxAU6IGJ5dGVzKTogdm9pZDsKCmVudW3TNCB7CiAgYGnEGC9wbmdgLMoPanBlxBB9Cg%3D%3D&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.