Skip to main content

spec-no-invalid-tag-parents

Requires every tag parent to name another declared tag and forbids parent cycles.

AttributeValue
CategoryMetadata
MaturityPlatinum
OpenAPIOpenAPI 3.2 only
Starter–StrictOff
Recommended–CompleteError

Intent

Valid parent links let documentation tools render a reliable tag hierarchy.

Flags

An undefined parent or any circular chain, including a tag that names itself.

Does not flag

Tags without parent. Earlier OpenAPI versions are outside this rule.

See it fail

openapi: 3.2.0
tags:
- name: payments
parent: commerce

Diagnostic: Tag parent 'commerce' is not defined in the API description.

Fix it

openapi: 3.2.0
tags:
- name: commerce
- name: payments
parent: commerce

Configure

profiles:
default:
rules:
extends: [recommended]
override:
spec-no-invalid-tag-parents: error

Nearby: tag-description, tags-alphabetical.