Anypoint Best Practices

(14 reviews)

not-anonymous-types

general > not-anonymous-types


Guidance / Message

Instead of inlining the definition of schemas in HTTP responses,
reference declared types to provide descriptive names for the federated types.

Examples

valid

200:
  description: Ok!
  headers:
    content-type:
      description: a header
      type: string
      example:
        'application/json'
  body:
    application/json:
      type: MessageResult

invalid

200:
  description: Ok!
  body:
    application/json:
      type: object
      description: "some description"
      additionalProperties: false
      properties:
        count:
          type: integer
        message:
          type: string

Applies to Operation

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