tags-sorted

tags-sorted

This rule checks whether tags defined in an OpenAPI schema are sorted alphabetically according to their names.

Rule Details

Keeping tags sorted alphabetically improves the readability of the API’s schema.

The tags-sorted rule checks all tags defined by an OpenAPI schema and raises an issue if the tags are not sorted.

Configuration

None.

Examples

Good.

tags:
  - name: Admin
  - name: Product
  - name: User

Bad.

tags:
  - name: User
  - name: Admin
  - name: Product

When Not to Use It

We recommend to always enable this rule.

Compatibility

This rule is compatible with all OpenAPI 3.x versions.

← Back to Index