Skip to content

Commit bab012d

Browse files
committed
Voeg uitzondering op trailing slash toe voor root resource
1 parent 21a2f68 commit bab012d

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
@@ -90,6 +90,9 @@ A resource that corresponds to a single conceptual entity is referred to as a [=
9090
<dt>Statement</dt>
9191
<dd>
9292
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 forces API consumers to use the correct [=URI=].
93+
<div class="note">
94+
This rule does not apply to the root resource (append <code>/</code> to the service root URL).
95+
</div>
9396
</dd>
9497
<dt>Rationale</dt>
9598
<dd>
@@ -99,11 +102,13 @@ A resource that corresponds to a single conceptual entity is referred to as a [=
99102
<pre class="nohighlight example-correct">https://api.example.org/v1/gebouwen</pre>
100103
<p>URI with a trailing slash (incorrect):</p>
101104
<pre class="nohighlight example-incorrect">https://api.example.org/v1/gebouwen/</pre>
105+
<p>URI for the root resource is exempt (correct):</p>
106+
<pre class="nohighlight example-correct">https://api.example.org/v1/</pre>
102107
</div>
103108
</dd>
104109
<dt>How to test</dt>
105110
<dd>
106-
Analyse all resource paths in the OpenAPI Description to confirm no resource paths end with a forward slash (<code>/</code>).
111+
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>).
107112
</dd>
108113
</dl>
109114
</div>

0 commit comments

Comments
 (0)