Page MenuHomePhabricator

Add the remaining linting rules
Closed, ResolvedPublic3 Estimated Story Points

Description

This set of rules finalizes the OpenAPI description validation mechanism of the linter. It contains rules necessary to lint the remaining structured objects that can be added to the OAD.

Conditions of acceptance

  • Validate that if any operation has tags defined, the global tags field is also defined (severity: warn) - example (a version of this rule is already implemented in wikimedia-operation-tags-defined and the built-in operation-tag-defined - Confirming that I checked this is true during the task!)
  • Validate that the info.license field is defined (severity: warn) - example
  • Validate that every server variable has a description (severity: info) - example
  • Validate that every external documentation object has a description. External documentation objects are defined in the externalDocs field throughout the OAD. (severity: warn) - example #1, example #2, example #3
  • Validate every link object according to the rules below. Link objects are defined in the links field in the components and response objects:
    • Validate that the link has either operationRef or operationId - but not both - defined (severity: error) - example #1, example #2
    • Validate that the link has a description (severity: warn) - example
  • Validate every tag object according to the rules below. Tag objects can only be defined in the top-level tags field.
    • Validate that the tag has a description (severity: info) - example
    • Validate that the tag has the externalDocs field defined (severity: hint) - example
  • Validate that every security scheme has a description. Security schemes can only be defined under the top-level securitySchemes field. (severity: info) - example

Extra resources

Event Timeline

BPirkle triaged this task as Medium priority.Apr 8 2026, 1:06 PM

I removed schema.example validation from the scope of this task. It's already partially implemented but requires some extra consideration in sync with T421375: Improve linting - requestBody and response examples.

kineticpelagic opened https://gitlab.wikimedia.org/toolforge-repos/wmf-openapi-linter/-/merge_requests/19

feat(linter): Finalize OpenAPI description validation mechanism for structured objects (T422600)

KineticPelagic added a subscriber: AGhirelli-WMF.

@AGhirelli-WMF , feel free to review the Merge Request and/or let me know any suggestions as to who can help review, which perhaps we will talk about in our handover meeting soon!

KineticPelagic reopened this task as In Progress.EditedMay 5 2026, 9:43 AM

^ Oops, I had changed the task status without intending to so I changed it back.

aghirelli merged https://gitlab.wikimedia.org/toolforge-repos/wmf-openapi-linter/-/merge_requests/19

feat(linter): Finalize OpenAPI description validation mechanism for structured objects (T422600)

Marking as resolved as part of sprint close out.