Anypoint Best Practices

(14 reviews)

no-2xx-response

general > no-2xx-response


Guidance / Message

HTTP resources not returning a 2xx success response do not describe normal responses from the API.

Examples

valid

get:
  responses:
    200:
      description: All profiles
      headers:
        content-type:
          description: a header
          type: string
          example:
            'application/json'
    404:
      description: Not found

invalid

get:
  responses:
    404:
      description: Not found
    500:
      description: some error
    # no 200 response here

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