Skip to content

Commit

Permalink
Multi-value query param should be noun if singular (#160)
Browse files Browse the repository at this point in the history
- multi-value query param should be noun if singular
- don't explicitly set param properties to their default in example OpenAPI
  • Loading branch information
pvdbosch authored Jan 30, 2024
1 parent bfa9df0 commit 79b5d9e
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions guide/src/main/asciidoc/resources.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -73,43 +73,39 @@ Only return translatable properties in dutch.
.Multiple values for the same query parameter
====
When a single query parameter can have multiple values, the parameter SHOULD be repeated for each value.
If the parameter's name is a noun, it SHOULD be singular.
====

.Multi-valued parameter
====
[subs=normal]
.Request
```
GET {API}/employers/93017373?embed=employees&embed=mainAddress
GET /cars?color=black&color=blue
```
.OpenAPI 2.0 definition
```YAML
parameters:
- name: embed
- name: color
in: query
collectionFormat: multi
type: array
items:
type: string
enum:
- employees
- mainAddress
```
.OpenAPI 3.0 definition
```YAML
parameters:
- name: embed
- name: color
in: query
explode: true
# defaults for style and explode properties are OK (style: form, explode: true)
schema:
type: array
items:
type: string
enum:
- employees
- mainAddress
```
====

Expand Down

0 comments on commit 79b5d9e

Please sign in to comment.