Skip to main content

xml-wrapped-only-for-array-schema-type

Overview

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

In OpenAPI specifications, XML serialization (wrapped) can be used to describe how to serialize and deserialize XML documents. The wrapped style applies to array schema types and defines how XML elements are named when representing arrays. This rule enforces the requirement that the wrapped style can only be used with array schema types to ensure that the schema is properly defined and can be used correctly.

PropertyValue
EnabledYes
Maximum SeverityError
MessageXML wrapped is only allowed for array schema type.
CodeOPENAPI3APIMATIC_L845
TypeLinting
Rule SystemSemantic
Broad CategoryOpenAPI XML
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi apimatic semantic linting xml array items wrapping schema

Suggested Fixes

  • Check the OpenAPI specification to confirm if any non-array schema types have the wrapped style specified.
  • If any non-array schema types have the wrapped style specified, remove the style from the schema definition.
  • If your XML data can have multiple element occurrences for the current schema definition, consider changing the schema type to array.

For More Information