-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(editor): retrieve parameter default value from dereferenced spec
closes #212
- Loading branch information
Showing
5 changed files
with
96 additions
and
2 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
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
36 changes: 36 additions & 0 deletions
36
packages/editor/tests/fixtures/oas2-default-param-value.result.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,36 @@ | ||
{ | ||
"children": [ | ||
{ | ||
"children": [ | ||
{ | ||
"jsonPointer": "/paths/~1pet/post", | ||
"method": "POST", | ||
"parameters": [ | ||
{ | ||
"bodyType": "application/json", | ||
"paramType": "requestBody", | ||
"value": { | ||
"name": "Jack" | ||
}, | ||
"valueJsonPointer": "/paths/~1pet/post/parameters/0/schema/default" | ||
} | ||
], | ||
"path": "/pet" | ||
} | ||
], | ||
"jsonPointer": "/paths/~1pet", | ||
"path": "/pet" | ||
} | ||
], | ||
"jsonPointer": "/", | ||
"name": "Swagger Petstore", | ||
"parameters": [ | ||
{ | ||
"name": "host", | ||
"paramType": "variable", | ||
"value": "petstore.swagger.io", | ||
"valueJsonPointer": "/host" | ||
} | ||
], | ||
"path": "/" | ||
} |
39 changes: 39 additions & 0 deletions
39
packages/editor/tests/fixtures/oas2-default-param-value.yaml
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,39 @@ | ||
swagger: '2.0' | ||
info: | ||
title: Swagger Petstore | ||
version: 1.0.0 | ||
host: petstore.swagger.io | ||
basePath: /v2 | ||
schemes: | ||
- https | ||
paths: | ||
/pet: | ||
post: | ||
consumes: | ||
- application/json | ||
parameters: | ||
- $ref: '#/parameters/ReferencedPostBodyParam' | ||
responses: | ||
200: | ||
description: successful operation | ||
parameters: | ||
ReferencedPostBodyParam: | ||
description: A JSON object containing pet information | ||
in: body | ||
name: body | ||
required: true | ||
schema: | ||
$ref: '#/definitions/Pet' | ||
definitions: | ||
Pet: | ||
properties: | ||
name: | ||
example: doggie | ||
type: string | ||
required: | ||
- name | ||
type: object | ||
xml: | ||
name: Pet | ||
default: | ||
name: Jack |
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