Azure / azure-openapi-validator

Azure Open API Validator
MIT License
47 stars 46 forks source link

Rule Update Request: Update to existing ApiVersionPattern rule to support canonical swagger #677

Open allenjzhang opened 5 months ago

allenjzhang commented 5 months ago

Lint rule description

ARM has a new initiative that will generate a canonical version of swagger from TypeSpec which amalgamate all versions of models into a single swagger file under a new canonical folder which is at same level of stable and preview.

The version specified in this JSON is hard coded to canonical. The combination of canonical folder and API version being canonical should bypass this check.

Related swagger example

https://github.com/Azure/azure-rest-api-specs-pr/blob/db68ae0972e72e68bed18e657281495ebc0dfe79/specification/dinwadevtest/resource-manager/Microsoft.Contoso/canonical/openapi.json#L5

Category

ARM

Severity level

Error

Applies to

Management plane API spec

How to fix the violation

The combination of canonical folder and API version being canonical should bypass this check with date-time format.

What't the impact if breaking the rule

N/A