This repository has been archived by the owner on Nov 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #225 from readmeio/bug/support-params-with-refs
Adding support for parameters that may have child `$ref` pointers.
- Loading branch information
Showing
4 changed files
with
166 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"openapi": "3.0.0", | ||
"servers": [ | ||
{ | ||
"url": "http://httpbin.org" | ||
} | ||
], | ||
"info": { | ||
"version": "1.0.0", | ||
"title": "An example of how we render $ref usage on resource parameters" | ||
}, | ||
"paths": { | ||
"/anything": { | ||
"get": { | ||
"summary": "Query param with a child $ref", | ||
"description": "", | ||
"parameters": [ | ||
{ | ||
"in": "query", | ||
"name": "array (with a $ref)", | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/components/schemas/string_enum" | ||
} | ||
} | ||
} | ||
], | ||
"responses": {} | ||
}, | ||
"post": { | ||
"summary": "Query param pointing to a $ref", | ||
"description": "", | ||
"parameters": [ | ||
{ | ||
"$ref": "#/components/parameters/limitParam" | ||
} | ||
], | ||
"responses": {} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"parameters": { | ||
"limitParam": { | ||
"in": "query", | ||
"name": "limit", | ||
"required": false, | ||
"schema": { | ||
"type": "integer", | ||
"minimum": 1, | ||
"maximum": 50, | ||
"default": 20 | ||
}, | ||
"description": "The numbers of items to return." | ||
} | ||
}, | ||
"schemas": { | ||
"string_enum": { | ||
"name": "string", | ||
"enum": [ | ||
"available", | ||
"pending", | ||
"sold" | ||
], | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters