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.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Warning |
| Message | The XML name is forbidden for non-wrapped array schemas. |
| Code | OPENAPI3APIMATIC_L844 |
| Type | Linting |
| Rule System | Semantic |
| Broad Category | OpenAPI XML |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | openapi3 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.