Anypoint Best Practices
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