Anypoint Best Practices

(14 reviews)

open-schemas-ignored

general > open-schemas-ignored


Guidance

Open schemas with a set of variable properties cannot be pre-processed by clients.
Define a closed schema with a finite set of properties described statically in the API definition.
AsyncAPI or OAS API definitions' object schemas are open by default and must be explicitly
closed using `additionalProperties: false`.

Message

"'{{shacl.name}}' is an open schema. Use `additionalProperties: false` make it a closed schema instead."

Examples

valid

types:
  MessageResult:
    type: object
    description: "some description"
    additionalProperties: false
    properties:
      count:
        type: integer

invalid

types:
  MessageResult:
    type: object # needs aditionalProperties: false
    description: "some description"
    properties:
      count:
        type: integer

Applies to NodeShape

Constraint

Type: Declarative Validation

Reviews

TypeRuleset
OrganizationMuleSoft
Published by
MuleSoft Organization
Published onDec 11, 2023
Asset overview

Asset versions for 1.6.x

Asset versions
VersionActions
1.6.1
1.6.0

Tags