Anypoint Best Practices

(14 reviews)

path-keys-no-trailing-slash

general > path-keys-no-trailing-slash


Guidance

Keep trailing slashes off of paths, as it can cause some confusion. Some web tooling (like mock servers, real
servers, code generators, application frameworks, etc.) will treat example.com/foo and example.com/foo/ as the
same thing, but other tooling will not. Avoid any confusion by just documenting them without the slash, and maybe
some tooling will let people shove a / on there when they're using it or maybe not, but at least the docs are
suggesting how it should be done properly.

Message

Path keys should not end with a trailing slash. '{{apiContract.path}}' is invalid.

Examples

valid

#%RAML 1.0
title: example api
version: 1.0.0
/events:

invalid

#%RAML 1.0
title: example api
version: 1.0.0
/events/:

Applies to EndPoint

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