Skip to main content

no-xml-name-in-non-wrapped-array-schema

Overview

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

In OpenAPI specifications, when using XML for array schemas, there are two ways to serialize an array: as a 'wrapped' array, where each element of the array is a child element of a container element, or as a 'non-wrapped' array, where each element of the array is a sibling element of the other elements. When using non-wrapped array schemas, specifying an XML name is forbidden. This rule enforces the requirement that an XML name cannot be specified for non-wrapped array schemas to ensure that the schema is properly defined and can be used correctly.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageThe XML name is forbidden for non-wrapped array schemas.
CodeOPENAPI3APIMATIC_L844
TypeLinting
Rule SystemSemantic
Broad CategoryOpenAPI XML
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi apimatic semantic linting non-wrapped array schema xml name

Suggested Fixes

  • Check the OpenAPI specification to confirm if any non-wrapped array schema has an XML name specified.
  • If any non-wrapped array schema has an XML name specified, remove the XML name from the schema definition.

For More Information