Closed saidone75 closed 5 months ago
Hi,
That should work, it's possibly a missing implementation. I will try to find time to look at this (PRs also welcome).
Thanks!
I've tried to reproduce it to understand if it was the same issue I was having (https://github.com/oliyh/martian/issues/195)
But I discovered that since you're using components
, you are using spec from OpenAPI v3, so adding openapi: "3.1.0"
solves the issue for you @saidone75
At least for me:
openapi: "3.0.1"
info:
components:
parameters:
offsetParam: # <-- Arbitrary name for the definition that will be used to refer to it.
# Not necessarily the same as the parameter name.
in: query
name: offset
required: false
schema:
type: integer
minimum: 0
description: The number of items to skip before starting to collect the result set.
limitParam:
in: query
name: limit
required: false
schema:
type: integer
minimum: 1
maximum: 50
default: 20
description: The numbers of items to return.
paths:
/users:
get:
operationId: getUsers
summary: Gets a list of users.
parameters:
- $ref: '#/components/parameters/offsetParam'
- $ref: '#/components/parameters/limitParam'
responses:
'200':
description: OK
then run bootstrap, works fine.
(let [client (martian-httpkit/bootstrap-openapi "/tmp/openapiv3-example.yaml")]
(martian/explore client :get-users))
=> {:summary "Gets a list of users.", :parameters {#schema.core.OptionalKey{:k :offset} Int, #schema.core.OptionalKey{:k :limit} (default Int 20)}, :returns {200 nil}}
I'd close this issue.
Thank you @RafaeLeal for the investigation and help
Hi, I read all the relevant issues but I'm still unable to use $ref for common parameters, e.g.: openapi:
and this will produce:
Am I missing something? Thanks, Marco