kin-openapi
kin-openapi copied to clipboard
arrays of objects as query parameters cause a crush
Hi,
Query parameters that are defined as arrays of objects (i.e not primitives) causing kin-openapi to crush with panic (schema has non primitive type ...)
This also the case when the items in the query paramaters array are defined with polymorphism like anyof, allof etc.
It seems that kin-openapi assumes that all query parameters arrays must contain only primitives. But this is a valid schema.
For example :
Consider the schema:
paths:
/nf-instances:
get:
- description: Names of the services offered by the NF
explode: false
in: query
name: service-names
required: false
schema:
items:
$ref: '#/components/schemas/ServiceName'
minItems: 1
type: array
uniqueItems: true
...
ServiceName:
anyOf:
- $ref: '#/components/schemas/ServiceName_anyOf'
- type: string
description: Service names known to NRF
And consider the following request:
nf-instances?service-names=npcf-am-policy-control
This request causes a panic. because the service-names items type is not a primitive.
Thanks, Oren