Skip to main content

array-level-xml-name-for-wrapped-schemas-only

Overview

This rule belongs to the openapi-v3-standards-linting ruleset and states that:

When XML name is defined alongside type being array (outside the items), it will only affect the wrapping element. Therefore, it should be set only if wrapped is true. If wrapped is false, it will be ignored.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageXML name has been specified outside the array items schema which is not a wrapped schema.
CodeOPENAPI3STANDARDS_L261
TypeLinting
Rule SystemSemantic
Broad CategoryXML
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi standards semantic linting name xml array items wrapping schema

Suggested Fixes

  • Did you mean to define the XML name for the array items? If so, move this information from outer schema to within the items schema definition.
  • Are your multiple XML elements expected to be wrapped in another XML element? If so, make sure you turn the wrapped flag as true in the array schema (outside items) and provide any relevant details about it using the xml property at the same level.
  • If you do not expect the XML elements to be wrapped in another XML element, remove the XML name provided in xml property at array schema level (outside items).

For More Information