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

linter: Implement remaining rules necessary to lint structured objects that can be added to the OAD

I checked that rules are consistent with OpenAPI Specification v3.0.0.

  • 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)
    • Per discussion with Kamil and Alex, verified that these existing rules implemented this feature.
  •  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
      • Found that wikimedia-require-tags-description already fulfills this requirement.
    •  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

As a side note, I noticed a spelling error to nitpick on the README.

Closes T422600

Edited by KineticPelagic

Merge request reports

Loading