Skip to main content

valid-schema-dollar-dynamic-anchor-format

Overview

This rule belongs to the openapi-v3-syntax-validation ruleset and states that:

Property $dynamicAnchor in a Schema Object is an identifier keyword used for creation of named fragments. The value of this property must start with a letter ([A-Za-z]) or underscore (_), followed by any number of letters, digits ([0-9]), hyphens (-), underscores (_), and periods (.).

PropertyValue
EnabledYes
Maximum SeverityError
MessageValue for $dynamicAnchor in Schema Object is invalid.
CodeOPENAPI3SYNTAX_V142
TypeValidation
Rule SystemSyntax
Broad CategorySchemas
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi syntax validation $dynamicAnchor dynamic anchor anchor json schema schema

Suggested Fixes

  • Ensure that the $dynamicAnchor value does not contain any forbidden characters.
  • Ensure that the $dynamicAnchor value follows the regex pattern: ^[A-Za-z_]+[A-Za-z0-9-_.]*$
  • Use only alpha-numeric characters, underscores, hyphens, and periods.
  • Ensure that the starting character is a letter or underscore. Numbers and other symbols cannot be used to start an $dynamicAnchor value.

For More Information