Skip to content

Commit f8f995d

Browse files
authored
Voeg uitzondering op trailing slash toe voor root resource
1 parent 512d015 commit f8f995d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sections/designRules.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ A resource that corresponds to a single conceptual entity is referred to as a [=
8585
<dt>Statement</dt>
8686
<dd>
8787
A [=URI=] MUST never contain a trailing slash. When requesting a resource including a trailing slash, this MUST result in a `404` (not found) error response and not a redirect. This enforces API consumers to use the correct [=URI=].
88+
<div class="note">
89+
This rule does not apply to the root resource (append <code>/</code> to the service root URL).
90+
</div>
8891
</dd>
8992
<dt>Rationale</dt>
9093
<dd>
@@ -94,11 +97,13 @@ A resource that corresponds to a single conceptual entity is referred to as a [=
9497
<pre class="nohighlight">https://api.example.org/v1/gebouwen</pre>
9598
<p>URI with a trailing slash (incorrect):</p>
9699
<pre class="nohighlight">https://api.example.org/v1/gebouwen/</pre>
100+
<p>URI for the root resource is exempt (correct):</p>
101+
<pre class="nohighlight">https://api.example.org/v1/</pre>
97102
</div>
98103
</dd>
99104
<dt>How to test</dt>
100105
<dd>
101-
Analyse all resource paths in the OpenAPI Description to confirm no resource paths end with a forward slash (<code>/</code>).
106+
Analyse all resource paths (except the root resource path) in the OpenAPI Description to confirm no resource paths end with a forward slash (<code>/</code>).
102107
</dd>
103108
</dl>
104109
</div>

0 commit comments

Comments
 (0)