guardrail
guardrail copied to clipboard
Support for `content` when describing parameters
Documented here: https://swagger.io/docs/specification/describing-parameters/ under schema vs content
Example Swagger definition that causes examples to fail with Error: Parameter 'foo' has no schema:
openapi: 3.0.1
info:
version: 1.0.0
paths:
/foo:
get:
operationId: getFoo
parameters:
- in: query
name: foo
content:
application/json:
schema:
$ref: '#/components/parameters/Foo'
required: true
responses:
204:
description: OK
components:
parameters:
Foo:
type: object
properties:
bar:
type: string
baz:
type: string
This would allow query strings in the format of:
/foo?foo={"bar":"value","baz":"value"}
and would deserialize that into Foo.
Woah, awesome!
I have a similar use case where I'd like to pass JSON query params.