Skip to content

Update the version format check for canonical swagger #707

@dinwa-ms

Description

@dinwa-ms

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

There are some discussion about it in the channel

image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions