Anypoint Best Practices

(15 reviews)

nil-union-antipattern

general > nil-union-antipattern


Guidance / Message

Nullable types might lead to null pointer errors.
Use the optional properties instead.

Examples

valid

types:
  unionType:
    type: date-only|string
    example: "Hello, world!"

invalid

types:
  unionType:
    type: string|nil
    example: "Hello, world!"

Applies to AnyShape

Constraint

Type: Rego Validation

Reviews

TypeRuleset
OrganizationMuleSoft
Published by
MuleSoft Organization
Published onNov 20, 2024
Asset overview

Asset versions for 1.6.x

Asset versions
VersionActions
1.6.3
1.6.1
1.6.0

Tags