[openapi to tsp] Fix `accept` header logic
- Dominant language
- TypeSpec
- Stars
- 4.8k
- Forks
- 736
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 1
Description
Given the following swagger definition:
```
"produces": [
"application/vnd.microsoft.appconfig.kv+json",
"application/problem+json"
],
```
The converter outputs the following typespec code where all of the supported content types are bundled into 1 string:
```
accept: "application/vnd.microsoft.appconfig.kv+json, application/problem+json";
```
The correct code should represent each content type individually:
```
accept: "application/vnd.microsoft.appconfig.kv+json" | "application/problem+json";
```
cc @joheredi
Contributor guide
Research direction
Start with the OpenAPI-to-TypeSpec converter logic that handles the Swagger `produces` field and maps it to the `accept` header. Verify the generated TypeSpec for multiple content types, and consider the work complete when each supported type is emitted as a separate union member rather than one comma-separated string.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100