I have an api to specify in openapi 3.0 (.yml)
I struggle with specifying an optional filter parameter. Especially with dynamic keys for featureId. I looked at: https://swagger.io/docs/specification/data-models/dictionaries/
featureId's look like this: dws33231j The amount of featureId objects can vary
My Data structure:
[
"featureId1" => [
"selectedOption1",
"selectedOption2"
],
"featureId2" => [
"selectedOption8"
],
...
]
curl should look like this: https://path/articles&filter[featureId1]=selectedOption1,selectedOption2,selectedOption6&filter[featureId2]=selectedOption8'
So far i have this, that is far from right. How do I specify dynamic keys?
components:
parameters:
filter:
name: filter
in: query
style: deepObject
allowReserved: true
description:
schema:
$ref: "#/components/schemas/filter"
schemas:
filter:
type: object
properties:
featureId1:
description: id of the feature
type: array
items:
type: string
example: [selectedOption1, selectedOption2, selectedOption6]