Skip to content

Commit

Permalink
[Feature] [SwaggerV2] Import Documentation and Authentification (#1724)
Browse files Browse the repository at this point in the history
* [Feature] [SwaggerV2] Import Documentation and Authentification
Partially implements #1698
Fixes #1007

* Update fixtures to reflect swagger2 importer changes
  • Loading branch information
Matthias Ramsauer authored and gschier committed Nov 22, 2019
1 parent 83be4a9 commit 65cd4b0
Show file tree
Hide file tree
Showing 5 changed files with 475 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,22 @@
{
"parentId": "__WORKSPACE_ID__",
"name": "Add a new pet to the store",
"description": "",
"url": "{{ base_url }}/pet",
"body": {
"mimeType": "application/json",
"text": "{\n \"id\": 0,\n \"category\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"name\": \"doggie\",\n \"photoUrls\": [\n \"string\"\n ],\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"string\"\n}"
},
"method": "POST",
"parameters": [],
"authentication": {
"authorizationUrl": "http://petstore.swagger.io/oauth/dialog",
"clientId": "{{ client_id }}",
"disabled": false,
"grantType": "authorization_code",
"scope": "write:pets read:pets",
"type": "oauth2"
},
"headers": [
{
"name": "Content-Type",
Expand All @@ -55,27 +64,36 @@
{
"parentId": "__WORKSPACE_ID__",
"name": "Update an existing pet",
"description": "",
"url": "{{ base_url }}/pet",
"body": {
"mimeType": "application/json",
"text": "{\n \"id\": 0,\n \"category\": {\n \"id\": 0,\n \"name\": \"string\"\n },\n \"name\": \"doggie\",\n \"photoUrls\": [\n \"string\"\n ],\n \"tags\": [\n {\n \"id\": 0,\n \"name\": \"string\"\n }\n ],\n \"status\": \"string\"\n}"
},
"method": "PUT",
"parameters": [],
"authentication": {
"authorizationUrl": "http://petstore.swagger.io/oauth/dialog",
"clientId": "{{ client_id }}",
"disabled": false,
"grantType": "authorization_code",
"scope": "write:pets read:pets",
"type": "oauth2"
},
"headers": [
{
"name": "Content-Type",
"disabled": false,
"value": "application/json"
}
],
"authentication": {},
"_type": "request",
"_id": "updatePet"
},
{
"parentId": "__WORKSPACE_ID__",
"name": "Finds Pets by status",
"description": "Multiple status values can be provided with comma separated strings",
"url": "{{ base_url }}/pet/findByStatus",
"body": {},
"method": "GET",
Expand All @@ -87,13 +105,21 @@
}
],
"headers": [],
"authentication": {},
"authentication": {
"authorizationUrl": "http://petstore.swagger.io/oauth/dialog",
"clientId": "{{ client_id }}",
"disabled": false,
"grantType": "authorization_code",
"scope": "write:pets read:pets",
"type": "oauth2"
},
"_type": "request",
"_id": "findPetsByStatus"
},
{
"parentId": "__WORKSPACE_ID__",
"name": "Finds Pets by tags",
"description": "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"url": "{{ base_url }}/pet/findByTags",
"body": {},
"method": "GET",
Expand All @@ -105,25 +131,40 @@
}
],
"headers": [],
"authentication": {},
"authentication": {
"authorizationUrl": "http://petstore.swagger.io/oauth/dialog",
"clientId": "{{ client_id }}",
"disabled": false,
"grantType": "authorization_code",
"scope": "write:pets read:pets",
"type": "oauth2"
},
"_type": "request",
"_id": "findPetsByTags"
},
{
"parentId": "__WORKSPACE_ID__",
"name": "Find pet by ID",
"description": "Returns a single pet",
"url": "{{ base_url }}/pet/{{ petId }}",
"body": {},
"method": "GET",
"parameters": [],
"headers": [],
"headers": [
{
"disabled": false,
"name": "api_key",
"value": "{{ api_key }}"
}
],
"authentication": {},
"_type": "request",
"_id": "getPetById"
},
{
"parentId": "__WORKSPACE_ID__",
"name": "Updates a pet in the store with form data",
"description": "",
"url": "{{ base_url }}/pet/{{ petId }}",
"body": {
"mimeType": "application/x-www-form-urlencoded",
Expand All @@ -142,20 +183,28 @@
},
"method": "POST",
"parameters": [],
"authentication": {
"authorizationUrl": "http://petstore.swagger.io/oauth/dialog",
"clientId": "{{ client_id }}",
"disabled": false,
"grantType": "authorization_code",
"scope": "write:pets read:pets",
"type": "oauth2"
},
"headers": [
{
"name": "Content-Type",
"disabled": false,
"value": "application/x-www-form-urlencoded"
}
],
"authentication": {},
"_type": "request",
"_id": "updatePetWithForm"
},
{
"parentId": "__WORKSPACE_ID__",
"name": "Deletes a pet",
"description": "",
"url": "{{ base_url }}/pet/{{ petId }}",
"body": {},
"method": "DELETE",
Expand All @@ -167,13 +216,21 @@
"value": "string"
}
],
"authentication": {},
"authentication": {
"authorizationUrl": "http://petstore.swagger.io/oauth/dialog",
"clientId": "{{ client_id }}",
"disabled": false,
"grantType": "authorization_code",
"scope": "write:pets read:pets",
"type": "oauth2"
},
"_type": "request",
"_id": "deletePet"
},
{
"parentId": "__WORKSPACE_ID__",
"name": "uploads an image",
"description": "",
"url": "{{ base_url }}/pet/{{ petId }}/uploadImage",
"body": {
"mimeType": "multipart/form-data",
Expand All @@ -192,32 +249,47 @@
},
"method": "POST",
"parameters": [],
"authentication": {
"authorizationUrl": "http://petstore.swagger.io/oauth/dialog",
"clientId": "{{ client_id }}",
"disabled": false,
"grantType": "authorization_code",
"scope": "write:pets read:pets",
"type": "oauth2"
},
"headers": [
{
"name": "Content-Type",
"disabled": false,
"value": "multipart/form-data"
}
],
"authentication": {},
"_type": "request",
"_id": "uploadFile"
},
{
"parentId": "__WORKSPACE_ID__",
"name": "Returns pet inventories by status",
"description": "Returns a map of status codes to quantities",
"url": "{{ base_url }}/store/inventory",
"body": {},
"method": "GET",
"parameters": [],
"headers": [],
"headers": [
{
"disabled": false,
"name": "api_key",
"value": "{{ api_key }}"
}
],
"authentication": {},
"_type": "request",
"_id": "getInventory"
},
{
"parentId": "__WORKSPACE_ID__",
"name": "Place an order for a pet",
"description": "",
"url": "{{ base_url }}/store/order",
"body": {},
"method": "POST",
Expand All @@ -230,6 +302,7 @@
{
"parentId": "__WORKSPACE_ID__",
"name": "Find purchase order by ID",
"description": "For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions",
"url": "{{ base_url }}/store/order/{{ orderId }}",
"body": {},
"method": "GET",
Expand All @@ -242,6 +315,7 @@
{
"parentId": "__WORKSPACE_ID__",
"name": "Delete purchase order by ID",
"description": "For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors",
"url": "{{ base_url }}/store/order/{{ orderId }}",
"body": {},
"method": "DELETE",
Expand All @@ -254,6 +328,7 @@
{
"parentId": "__WORKSPACE_ID__",
"name": "Create user",
"description": "This can only be done by the logged in user.",
"url": "{{ base_url }}/user",
"body": {},
"method": "POST",
Expand All @@ -266,6 +341,7 @@
{
"parentId": "__WORKSPACE_ID__",
"name": "Creates list of users with given input array",
"description": "",
"url": "{{ base_url }}/user/createWithArray",
"body": {},
"method": "POST",
Expand All @@ -278,6 +354,7 @@
{
"parentId": "__WORKSPACE_ID__",
"name": "Creates list of users with given input array",
"description": "",
"url": "{{ base_url }}/user/createWithList",
"body": {},
"method": "POST",
Expand All @@ -290,6 +367,7 @@
{
"parentId": "__WORKSPACE_ID__",
"name": "Logs user into the system",
"description": "",
"url": "{{ base_url }}/user/login",
"body": {},
"method": "GET",
Expand All @@ -313,6 +391,7 @@
{
"parentId": "__WORKSPACE_ID__",
"name": "Logs out current logged in user session",
"description": "",
"url": "{{ base_url }}/user/logout",
"body": {},
"method": "GET",
Expand All @@ -325,6 +404,7 @@
{
"parentId": "__WORKSPACE_ID__",
"name": "Get user by user name",
"description": "",
"url": "{{ base_url }}/user/{{ username }}",
"body": {},
"method": "GET",
Expand All @@ -337,6 +417,7 @@
{
"parentId": "__WORKSPACE_ID__",
"name": "Updated user",
"description": "This can only be done by the logged in user.",
"url": "{{ base_url }}/user/{{ username }}",
"body": {},
"method": "PUT",
Expand All @@ -349,6 +430,7 @@
{
"parentId": "__WORKSPACE_ID__",
"name": "Delete user",
"description": "This can only be done by the logged in user.",
"url": "{{ base_url }}/user/{{ username }}",
"body": {},
"method": "DELETE",
Expand Down
Loading

0 comments on commit 65cd4b0

Please sign in to comment.