I have a GET route where I would like to encode an object parameter in the URL as a query string.
When writing swagger documentation, I mostly get errors that prevent me from using schema/ types objectin a type parameter query:
paths:
/mypath/:
get:
parameters
- in: path
name: someParam
description: some param that works
required: true
type: string
format: timeuuid #good param, works well
- $ref: "#/parameters/mySortingParam" #this yields an error
parameters:
mySortingParam
name: paging
in: query
description: Holds various paging attributes
required: false
schema:
type: object
properties:
pageSize:
type: number
cursor:
type: object
properties:
after:
type: string
format: string
The request request parameter having the value of the object will be encoded in the real request.
Despite the fact that swagger shows an error at the top of the screen, the object is rendered correctly in the swagger user interface editor, but this error spreads over the documentation.
source
share