Skip to main content

only-scalar-types-for-xml-attribute

Overview

This rule belongs to the apimatic-preliminary-validation ruleset and states that:

A field declared as an attribute must only use scalar data types.

PropertyValue
EnabledYes
Maximum SeverityError
MessageThe model field is configured as an XML attribute but does not use a scalar data type.
CodeAPIMATICPRE_V603
TypeValidation
Rule SystemSemantic
Broad CategoryXML Attributes
Products ImpactedCode Generation, Developer Experience Portal, API Transformer
Tagspreliminary checks validation apimatic type scalar type primitive type xml attribute xml

Suggested Fixes

  • Valid types for fields declared as XML attributes: String, Number, Long, Precision, Boolean, DateTime, Date, Time, UUID and enumeration custom types.
  • Change the type of field to one supported for XML attributes.
  • Disable the "IsAttribute" flag in the field's XML attributes.
  • Remove the field definition from the complex type/model definition.

For More Information