-
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): pick correct media type on parameter parsing (#215)
closes #214
- Loading branch information
Showing
6 changed files
with
238 additions
and
7 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
36 changes: 36 additions & 0 deletions
36
packages/editor/tests/fixtures/oas2-missing-consumes.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": "/" | ||
} |
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,32 @@ | ||
swagger: '2.0' | ||
info: | ||
title: Swagger Petstore | ||
version: 1.0.0 | ||
host: petstore.swagger.io | ||
basePath: /v2 | ||
schemes: | ||
- https | ||
paths: | ||
/pet: | ||
post: | ||
parameters: | ||
- in: body | ||
name: body | ||
schema: | ||
$ref: '#/definitions/Pet' | ||
responses: | ||
200: | ||
description: successful operation | ||
definitions: | ||
Pet: | ||
properties: | ||
name: | ||
example: doggie | ||
type: string | ||
required: | ||
- name | ||
type: object | ||
xml: | ||
name: Pet | ||
default: | ||
name: Jack |
59 changes: 59 additions & 0 deletions
59
packages/editor/tests/fixtures/oas2-override-consumes.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,59 @@ | ||
{ | ||
"children": [ | ||
{ | ||
"children": [ | ||
{ | ||
"jsonPointer": "/paths/~1pet/post", | ||
"method": "POST", | ||
"parameters": [ | ||
{ | ||
"bodyType": "application/x-www-form-urlencoded", | ||
"paramType": "requestBody", | ||
"value": { | ||
"name": "Jack" | ||
}, | ||
"valueJsonPointer": "/paths/~1pet/post/parameters/0/schema/default" | ||
}, | ||
{ | ||
"bodyType": "multipart/form-data", | ||
"paramType": "requestBody", | ||
"value": { | ||
"name": "Jack" | ||
}, | ||
"valueJsonPointer": "/paths/~1pet/post/parameters/0/schema/default" | ||
} | ||
], | ||
"path": "/pet" | ||
}, | ||
{ | ||
"jsonPointer": "/paths/~1pet/put", | ||
"method": "PUT", | ||
"parameters": [ | ||
{ | ||
"bodyType": "application/json", | ||
"paramType": "requestBody", | ||
"value": { | ||
"name": "Jack" | ||
}, | ||
"valueJsonPointer": "/paths/~1pet/put/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": "/" | ||
} |
49 changes: 49 additions & 0 deletions
49
packages/editor/tests/fixtures/oas2-override-consumes.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,49 @@ | ||
swagger: '2.0' | ||
info: | ||
title: Swagger Petstore | ||
version: 1.0.0 | ||
host: petstore.swagger.io | ||
basePath: /v2 | ||
schemes: | ||
- https | ||
consumes: | ||
- application/xml | ||
paths: | ||
/pet: | ||
post: | ||
consumes: | ||
- application/x-www-form-urlencoded | ||
- multipart/form-data | ||
parameters: | ||
- in: body | ||
name: body | ||
schema: | ||
$ref: '#/definitions/Pet' | ||
responses: | ||
200: | ||
description: successful operation | ||
put: | ||
consumes: | ||
- | ||
parameters: | ||
- in: body | ||
name: body | ||
schema: | ||
$ref: '#/definitions/Pet' | ||
responses: | ||
200: | ||
description: successful operation | ||
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