AsyncAPI Best Practices

(0 reviews)

asyncapi-channel-no-trailing-slash

general > asyncapi-channel-no-trailing-slash


Guidance

Keep trailing slashes off of channel names, as it can cause some confusion. Most messaging protocols will treat

example/foo and example/foo/ as different things. Keep in mind that tooling may replace slashes (/) with

protocol-specific notation (e.g.: . for AMQP); therefore, a trailing slash may result in an invalid channel name

in some protocols.

Message

Channel "{{apiContract.path}}" should not end with a slash.

Examples

valid

channels:
  /endpoint:
    subscribe:
      operationId: subs-ops
      message:
        x-pageSize: 5

invalid

channels:
  /endpoint/:
    subscribe:
      operationId: subs-ops
      message:
        x-pageSize: 5

Applies to EndPoint

Constraint

Type: Declarative Validation

Reviews

TypeRuleset
OrganizationMuleSoft
Published by
MuleSoft Organization
Published onNov 29, 2023
Asset overview

Asset versions for 1.1.x

Asset versions
VersionActions
1.1.0

Tags