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.
fix: oas-to-har now supports common parameters (#462)
- Loading branch information
Showing
4 changed files
with
147 additions
and
58 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 |
---|---|---|
@@ -1,67 +1,63 @@ | ||
{ | ||
"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/{id}": { | ||
"parameters": [ | ||
{ | ||
"in": "path", | ||
"name": "id", | ||
"schema": { | ||
"type": "number" | ||
} | ||
"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/{id}": { | ||
"parameters": [ | ||
{ | ||
"in": "path", | ||
"name": "id", | ||
"schema": { | ||
"type": "number" | ||
} | ||
], | ||
"get": { | ||
"summary": "Get anything", | ||
"description": "", | ||
"responses": {} | ||
}, | ||
"post": { | ||
"summary": "Post anything", | ||
"description": "", | ||
"parameters": [ | ||
{ | ||
"$ref": "#/components/parameters/limitParam" | ||
} | ||
], | ||
"responses": {} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"parameters": { | ||
"limitParam": { | ||
"in": "query", | ||
"name": "limit", | ||
"required": false, | ||
{ | ||
"in": "header", | ||
"name": "x-extra-id", | ||
"schema": { | ||
"type": "integer", | ||
"minimum": 1, | ||
"maximum": 50, | ||
"default": 20 | ||
}, | ||
"description": "The numbers of items to return." | ||
"type": "string" | ||
} | ||
} | ||
], | ||
"get": { | ||
"summary": "Get anything", | ||
"description": "", | ||
"responses": {} | ||
}, | ||
"schemas": { | ||
"string_enum": { | ||
"name": "string", | ||
"enum": [ | ||
"available", | ||
"pending", | ||
"sold" | ||
], | ||
"type": "string" | ||
} | ||
"post": { | ||
"summary": "Post anything", | ||
"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." | ||
} | ||
} | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
packages/oas-to-har/__tests__/fixtures/common-parameters.json
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,54 @@ | ||
{ | ||
"openapi": "3.0.0", | ||
"servers": [ | ||
{ | ||
"url": "http://httpbin.org" | ||
} | ||
], | ||
"paths": { | ||
"/anything/{id}": { | ||
"parameters": [ | ||
{ | ||
"in": "path", | ||
"name": "id", | ||
"schema": { | ||
"type": "number" | ||
} | ||
}, | ||
{ | ||
"in": "header", | ||
"name": "x-extra-id", | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
], | ||
"post": { | ||
"summary": "Post anything", | ||
"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." | ||
} | ||
} | ||
} | ||
} |
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