Anypoint Best Practices

(14 reviews)

preferred-media-type-representations

general > preferred-media-type-representations


Guidance / Message

Do not use '{{core.mediaType}}' as media type. If there is no standard media type and format, use extensible formats such as JSON (application/json) and XML (application/xml).

Examples

valid

responses:
  200:
    description: Ok!
    body:
      application/xml:
        type: string

invalid

responses:
  200:
    body:
      text/html:
        type: string
        example: Text!

Applies to Payload

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