required-xml-name-for-arrays
Overview
This rule belongs to the openapi-v3-standards-linting
ruleset and states that:
When using arrays, XML element names are not inferred (for singular/plural forms) and the name property should be used to add that information. For wrapped schemas, the name should be specified outside the items schema for the wrapping element and inside the items schema for the inner elements. For non-wrapped schemas, the name should be specified inside the items schema only.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Warning |
Message | XML element name is missing for the array schema. |
Code | OPENAPI3STANDARDS_L260 |
Type | Linting |
Rule System | Semantic |
Broad Category | XML |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic linting name xml array items wrapping schema |
Suggested Fixes
- Make sure that there is a non-empty non-null name specified in the
items
schema definition using thename
property. - If your array schema has wrapping enabled using the
wrapped
flag, you will also need to specify a non-empty non-null name outside theitems
schema using thename
property. - Make sure that the name value is not null or empty.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#xml-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schema-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#xml-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schema-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md
- https://docs.apimatic.io/rulesets/overview/