Azure / Azure/azure-openapi-validator
Group content/media type warnings.
- Dominant language
- TypeScript
- Stars
- 53
- Forks
- 57
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 2
Description
Currently, of "consumes", "produces" has several different unsupported content types, such as
```json
"consumes": [
"application/json",
"text/json",
"application/xml",
"text/xml",
"application/x-www-form-urlencoded"
],
"produces": [
"application/json",
"text/json",
"application/xml",
"text/xml"
],
```
the linter tool gives several warnings. One warning for each unsupported content type. IMHO, it would be good if we show only one warning. The warning message should contain all unsupported types.
For example, current messages
```json
{
"type": "Warning",
"code": "NonApplicationJsonType",
"message": "Please make sure that media types other than 'application/json' are supported by your service.",
"id": "R2004",
"validationCategory": "SDKViolation",
...
}
{
"type": "Warning",
"code": "NonApplicationJsonType",
"message": "Please make sure that media types other than 'application/json' are supported by your service.",
"id": "R2004",
"validationCategory": "SDKViolation",
...
}
```
New message should be like this
```json
{
"type": "Warning",
"code": "NonApplicationJsonType",
"message": "Please make sure that media types 'text/json', 'application/xml', 'text/xml' (other than 'application/json') are supported by your service.",
"id": "R2004",
...
]
}
```
Contributor guide
Assessment
This issue has not been assessed yet.