Azure / Azure/azure-openapi-validator

Update the version format check for canonical swagger

Open
#707 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
53
Forks
57
Avg merge
1d 23h
Merged PRs (30d)
2

Description

### Lint rule description

For canonical swagger, the version info is "canonical", which violates the existing rule of the formate "Year-Month-Date". Can we make this a special case for canonical swagger?

![image](https://github.com/Azure/azure-openapi-validator/assets/8683976/cd167336-5f9c-4800-880a-126c2780a3e0)

There are some discussion about it in the channel

![image](https://github.com/Azure/azure-openapi-validator/assets/8683976/e7b0f5b2-92b4-44cf-b331-903d906e6b3f)

### Related swagger example

{
"swagger": "2.0",
"info": {
"title": "Microsoft.Contoso management service",
"version": "canonical",
"description": "Microsoft.Contoso Resource Provider management API.",
"x-canonical-included-versions": [
"v2021_10_01_preview"
],
"x-typespec-generated": [
{
"emitter": "@azure-tools/typespec-autorest-canonical"
}
]
},
"schemes": [
"https"
],
...

### Category

SDK

### Severity level

Error

### Applies to

Management plane API spec, Data plane API spec, RPaaS API spec

### How to fix the violation

For canonical swagger, set the version to "canonical"; for versioned swagger, set the version to the specific version.

### What't the impact if breaking the rule

The information will be misleading.

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.