Azure / Azure/azure-openapi-validator

Group content/media type warnings.

Open
#89 0 comments 0 reactions 0 assignees View on GitHub
Sprint-111
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

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.