mirror of
https://github.com/Kong/insomnia.git
synced 2026-10-25 16:19:20 -04:00
Port same deterministic logic from OpenAPI 3 to Swagger 2 importer (#2474)
Co-authored-by: Opender Singh <opender94@gmail.com>
This commit is contained in:
1 parent
784357f089
commit
c90306b35e
8 files changed
+136
-131
No files matched your search
+26
-26
@@ -18,10 +18,10 @@
|
||||
"base_url": "{{ scheme }}://{{ host }}{{ base_path }}"
|
||||
},
|
||||
"_type": "environment",
|
||||
"_id": "__ENV_1__"
|
||||
"_id": "__BASE_ENVIRONMENT_ID__"
|
||||
},
|
||||
{
|
||||
"parentId": "__ENV_1__",
|
||||
"parentId": "__BASE_ENVIRONMENT_ID__",
|
||||
"name": "Swagger env",
|
||||
"data": {
|
||||
"base_path": "/v2",
|
||||
@@ -29,10 +29,10 @@
|
||||
"host": "petstore.swagger.io"
|
||||
},
|
||||
"_type": "environment",
|
||||
"_id": "__ENV_2__"
|
||||
"_id": "env___BASE_ENVIRONMENT_ID___sub"
|
||||
},
|
||||
{
|
||||
"_id": "__GRP_1__",
|
||||
"_id": "fld___WORKSPACE_ID__1b034c38",
|
||||
"_type": "request_group",
|
||||
"description": "",
|
||||
"environment": {},
|
||||
@@ -40,7 +40,7 @@
|
||||
"parentId": "__WORKSPACE_ID__"
|
||||
},
|
||||
{
|
||||
"_id": "__GRP_2__",
|
||||
"_id": "fld___WORKSPACE_ID__3a21295d",
|
||||
"_type": "request_group",
|
||||
"description": "",
|
||||
"environment": {},
|
||||
@@ -48,7 +48,7 @@
|
||||
"parentId": "__WORKSPACE_ID__"
|
||||
},
|
||||
{
|
||||
"_id": "__GRP_3__",
|
||||
"_id": "fld___WORKSPACE_ID__12dea96f",
|
||||
"_type": "request_group",
|
||||
"description": "",
|
||||
"environment": {},
|
||||
@@ -56,7 +56,7 @@
|
||||
"parentId": "__WORKSPACE_ID__"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"name": "Add a new pet to the store",
|
||||
"description": "",
|
||||
"url": "{{ base_url }}/pet",
|
||||
@@ -85,7 +85,7 @@
|
||||
"_id": "addPet"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"name": "Update an existing pet",
|
||||
"description": "",
|
||||
"url": "{{ base_url }}/pet",
|
||||
@@ -114,7 +114,7 @@
|
||||
"_id": "updatePet"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"name": "Finds Pets by status",
|
||||
"description": "Multiple status values can be provided with comma separated strings",
|
||||
"url": "{{ base_url }}/pet/findByStatus",
|
||||
@@ -140,7 +140,7 @@
|
||||
"_id": "findPetsByStatus"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"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",
|
||||
@@ -166,7 +166,7 @@
|
||||
"_id": "findPetsByTags"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"name": "Find pet by ID",
|
||||
"description": "Returns a single pet",
|
||||
"url": "{{ base_url }}/pet/{{ petId }}",
|
||||
@@ -185,7 +185,7 @@
|
||||
"_id": "getPetById"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"name": "Updates a pet in the store with form data",
|
||||
"description": "",
|
||||
"url": "{{ base_url }}/pet/{{ petId }}",
|
||||
@@ -225,7 +225,7 @@
|
||||
"_id": "updatePetWithForm"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"name": "Deletes a pet",
|
||||
"description": "",
|
||||
"url": "{{ base_url }}/pet/{{ petId }}",
|
||||
@@ -251,7 +251,7 @@
|
||||
"_id": "deletePet"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"name": "uploads an image",
|
||||
"description": "",
|
||||
"url": "{{ base_url }}/pet/{{ petId }}/uploadImage",
|
||||
@@ -291,7 +291,7 @@
|
||||
"_id": "uploadFile"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_2__",
|
||||
"parentId": "fld___WORKSPACE_ID__3a21295d",
|
||||
"name": "Returns pet inventories by status",
|
||||
"description": "Returns a map of status codes to quantities",
|
||||
"url": "{{ base_url }}/store/inventory",
|
||||
@@ -310,7 +310,7 @@
|
||||
"_id": "getInventory"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_2__",
|
||||
"parentId": "fld___WORKSPACE_ID__3a21295d",
|
||||
"name": "Place an order for a pet",
|
||||
"description": "",
|
||||
"url": "{{ base_url }}/store/order",
|
||||
@@ -323,7 +323,7 @@
|
||||
"_id": "placeOrder"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_2__",
|
||||
"parentId": "fld___WORKSPACE_ID__3a21295d",
|
||||
"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 }}",
|
||||
@@ -336,7 +336,7 @@
|
||||
"_id": "getOrderById"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_2__",
|
||||
"parentId": "fld___WORKSPACE_ID__3a21295d",
|
||||
"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 }}",
|
||||
@@ -349,7 +349,7 @@
|
||||
"_id": "deleteOrder"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"name": "Create user",
|
||||
"description": "This can only be done by the logged in user.",
|
||||
"url": "{{ base_url }}/user",
|
||||
@@ -362,7 +362,7 @@
|
||||
"_id": "createUser"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"name": "Creates list of users with given input array",
|
||||
"description": "",
|
||||
"url": "{{ base_url }}/user/createWithArray",
|
||||
@@ -375,7 +375,7 @@
|
||||
"_id": "createUsersWithArrayInput"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"name": "Creates list of users with given input array",
|
||||
"description": "",
|
||||
"url": "{{ base_url }}/user/createWithList",
|
||||
@@ -388,7 +388,7 @@
|
||||
"_id": "createUsersWithListInput"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"name": "Logs user into the system",
|
||||
"description": "",
|
||||
"url": "{{ base_url }}/user/login",
|
||||
@@ -412,7 +412,7 @@
|
||||
"_id": "loginUser"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"name": "Logs out current logged in user session",
|
||||
"description": "",
|
||||
"url": "{{ base_url }}/user/logout",
|
||||
@@ -425,7 +425,7 @@
|
||||
"_id": "logoutUser"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"name": "Get user by user name",
|
||||
"description": "",
|
||||
"url": "{{ base_url }}/user/{{ username }}",
|
||||
@@ -438,7 +438,7 @@
|
||||
"_id": "getUserByName"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"name": "Updated user",
|
||||
"description": "This can only be done by the logged in user.",
|
||||
"url": "{{ base_url }}/user/{{ username }}",
|
||||
@@ -451,7 +451,7 @@
|
||||
"_id": "updateUser"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"name": "Delete user",
|
||||
"description": "This can only be done by the logged in user.",
|
||||
"url": "{{ base_url }}/user/{{ username }}",
|
||||
|
||||
+26
-26
@@ -12,7 +12,7 @@
|
||||
"parentId": null
|
||||
},
|
||||
{
|
||||
"_id": "__ENV_1__",
|
||||
"_id": "__BASE_ENVIRONMENT_ID__",
|
||||
"_type": "environment",
|
||||
"data": {
|
||||
"base_url": "{{ scheme }}://{{ host }}{{ base_path }}"
|
||||
@@ -21,7 +21,7 @@
|
||||
"parentId": "__WORKSPACE_ID__"
|
||||
},
|
||||
{
|
||||
"_id": "__ENV_2__",
|
||||
"_id": "env___BASE_ENVIRONMENT_ID___sub",
|
||||
"_type": "environment",
|
||||
"data": {
|
||||
"base_path": "/v2",
|
||||
@@ -29,10 +29,10 @@
|
||||
"scheme": "http"
|
||||
},
|
||||
"name": "Swagger env",
|
||||
"parentId": "__ENV_1__"
|
||||
"parentId": "__BASE_ENVIRONMENT_ID__"
|
||||
},
|
||||
{
|
||||
"_id": "__GRP_1__",
|
||||
"_id": "fld___WORKSPACE_ID__1b034c38",
|
||||
"_type": "request_group",
|
||||
"description": "Everything about your Pets",
|
||||
"environment": {},
|
||||
@@ -40,7 +40,7 @@
|
||||
"parentId": "__WORKSPACE_ID__"
|
||||
},
|
||||
{
|
||||
"_id": "__GRP_2__",
|
||||
"_id": "fld___WORKSPACE_ID__3a21295d",
|
||||
"_type": "request_group",
|
||||
"description": "Access to Petstore orders",
|
||||
"environment": {},
|
||||
@@ -48,7 +48,7 @@
|
||||
"parentId": "__WORKSPACE_ID__"
|
||||
},
|
||||
{
|
||||
"_id": "__GRP_3__",
|
||||
"_id": "fld___WORKSPACE_ID__12dea96f",
|
||||
"_type": "request_group",
|
||||
"description": "Operations about user",
|
||||
"environment": {},
|
||||
@@ -81,7 +81,7 @@
|
||||
"method": "POST",
|
||||
"name": "Add a new pet to the store",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"url": "{{ base_url }}/pet"
|
||||
},
|
||||
{
|
||||
@@ -110,7 +110,7 @@
|
||||
"method": "PUT",
|
||||
"name": "Update an existing pet",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"url": "{{ base_url }}/pet"
|
||||
},
|
||||
{
|
||||
@@ -136,7 +136,7 @@
|
||||
"value": "available"
|
||||
}
|
||||
],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"url": "{{ base_url }}/pet/findByStatus"
|
||||
},
|
||||
{
|
||||
@@ -162,7 +162,7 @@
|
||||
"value": "string"
|
||||
}
|
||||
],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"url": "{{ base_url }}/pet/findByTags"
|
||||
},
|
||||
{
|
||||
@@ -181,7 +181,7 @@
|
||||
"method": "GET",
|
||||
"name": "Find pet by ID",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"url": "{{ base_url }}/pet/{{ petId }}"
|
||||
},
|
||||
{
|
||||
@@ -221,7 +221,7 @@
|
||||
"method": "POST",
|
||||
"name": "Updates a pet in the store with form data",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"url": "{{ base_url }}/pet/{{ petId }}"
|
||||
},
|
||||
{
|
||||
@@ -247,7 +247,7 @@
|
||||
"method": "DELETE",
|
||||
"name": "Deletes a pet",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"url": "{{ base_url }}/pet/{{ petId }}"
|
||||
},
|
||||
{
|
||||
@@ -287,7 +287,7 @@
|
||||
"method": "POST",
|
||||
"name": "uploads an image",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"url": "{{ base_url }}/pet/{{ petId }}/uploadImage"
|
||||
},
|
||||
{
|
||||
@@ -306,7 +306,7 @@
|
||||
"method": "GET",
|
||||
"name": "Returns pet inventories by status",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_2__",
|
||||
"parentId": "fld___WORKSPACE_ID__3a21295d",
|
||||
"url": "{{ base_url }}/store/inventory"
|
||||
},
|
||||
{
|
||||
@@ -319,7 +319,7 @@
|
||||
"method": "POST",
|
||||
"name": "Place an order for a pet",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_2__",
|
||||
"parentId": "fld___WORKSPACE_ID__3a21295d",
|
||||
"url": "{{ base_url }}/store/order"
|
||||
},
|
||||
{
|
||||
@@ -332,7 +332,7 @@
|
||||
"method": "GET",
|
||||
"name": "Find purchase order by ID",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_2__",
|
||||
"parentId": "fld___WORKSPACE_ID__3a21295d",
|
||||
"url": "{{ base_url }}/store/order/{{ orderId }}"
|
||||
},
|
||||
{
|
||||
@@ -345,7 +345,7 @@
|
||||
"method": "DELETE",
|
||||
"name": "Delete purchase order by ID",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_2__",
|
||||
"parentId": "fld___WORKSPACE_ID__3a21295d",
|
||||
"url": "{{ base_url }}/store/order/{{ orderId }}"
|
||||
},
|
||||
{
|
||||
@@ -358,7 +358,7 @@
|
||||
"method": "POST",
|
||||
"name": "Create user",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"url": "{{ base_url }}/user"
|
||||
},
|
||||
{
|
||||
@@ -371,7 +371,7 @@
|
||||
"method": "POST",
|
||||
"name": "Creates list of users with given input array",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"url": "{{ base_url }}/user/createWithArray"
|
||||
},
|
||||
{
|
||||
@@ -384,7 +384,7 @@
|
||||
"method": "POST",
|
||||
"name": "Creates list of users with given input array",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"url": "{{ base_url }}/user/createWithList"
|
||||
},
|
||||
{
|
||||
@@ -408,7 +408,7 @@
|
||||
"value": "string"
|
||||
}
|
||||
],
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"url": "{{ base_url }}/user/login"
|
||||
},
|
||||
{
|
||||
@@ -421,7 +421,7 @@
|
||||
"method": "GET",
|
||||
"name": "Logs out current logged in user session",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"url": "{{ base_url }}/user/logout"
|
||||
},
|
||||
{
|
||||
@@ -434,7 +434,7 @@
|
||||
"method": "GET",
|
||||
"name": "Get user by user name",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"url": "{{ base_url }}/user/{{ username }}"
|
||||
},
|
||||
{
|
||||
@@ -447,7 +447,7 @@
|
||||
"method": "PUT",
|
||||
"name": "Updated user",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"url": "{{ base_url }}/user/{{ username }}"
|
||||
},
|
||||
{
|
||||
@@ -460,7 +460,7 @@
|
||||
"method": "DELETE",
|
||||
"name": "Delete user",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"url": "{{ base_url }}/user/{{ username }}"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
"base_url": "{{ scheme }}://{{ host }}{{ base_path }}"
|
||||
},
|
||||
"_type": "environment",
|
||||
"_id": "__ENV_1__"
|
||||
"_id": "__BASE_ENVIRONMENT_ID__"
|
||||
},
|
||||
{
|
||||
"parentId": "__ENV_1__",
|
||||
"parentId": "__BASE_ENVIRONMENT_ID__",
|
||||
"name": "Swagger env",
|
||||
"data": {
|
||||
"base_path": "/v2",
|
||||
@@ -29,10 +29,10 @@
|
||||
"host": "petstore.swagger.io"
|
||||
},
|
||||
"_type": "environment",
|
||||
"_id": "__ENV_2__"
|
||||
"_id": "env___BASE_ENVIRONMENT_ID___sub"
|
||||
},
|
||||
{
|
||||
"_id": "__GRP_1__",
|
||||
"_id": "fld___WORKSPACE_ID__1b034c38",
|
||||
"_type": "request_group",
|
||||
"description": "",
|
||||
"environment": {},
|
||||
@@ -40,7 +40,7 @@
|
||||
"parentId": "__WORKSPACE_ID__"
|
||||
},
|
||||
{
|
||||
"_id": "__GRP_2__",
|
||||
"_id": "fld___WORKSPACE_ID__3a21295d",
|
||||
"_type": "request_group",
|
||||
"description": "",
|
||||
"environment": {},
|
||||
@@ -48,7 +48,7 @@
|
||||
"parentId": "__WORKSPACE_ID__"
|
||||
},
|
||||
{
|
||||
"_id": "__GRP_3__",
|
||||
"_id": "fld___WORKSPACE_ID__12dea96f",
|
||||
"_type": "request_group",
|
||||
"description": "",
|
||||
"environment": {},
|
||||
@@ -56,7 +56,7 @@
|
||||
"parentId": "__WORKSPACE_ID__"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"name": "Add a new pet to the store",
|
||||
"description": "",
|
||||
"url": "{{ base_url }}/pet",
|
||||
@@ -85,7 +85,7 @@
|
||||
"_id": "addPet"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"name": "Update an existing pet",
|
||||
"description": "",
|
||||
"url": "{{ base_url }}/pet",
|
||||
@@ -114,7 +114,7 @@
|
||||
"_id": "updatePet"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"name": "Finds Pets by status",
|
||||
"description": "Multiple status values can be provided with comma separated strings",
|
||||
"url": "{{ base_url }}/pet/findByStatus",
|
||||
@@ -140,7 +140,7 @@
|
||||
"_id": "findPetsByStatus"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"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",
|
||||
@@ -166,7 +166,7 @@
|
||||
"_id": "findPetsByTags"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"name": "Find pet by ID",
|
||||
"description": "Returns a single pet",
|
||||
"url": "{{ base_url }}/pet/{{ petId }}",
|
||||
@@ -185,7 +185,7 @@
|
||||
"_id": "getPetById"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"name": "Updates a pet in the store with form data",
|
||||
"description": "",
|
||||
"url": "{{ base_url }}/pet/{{ petId }}",
|
||||
@@ -225,7 +225,7 @@
|
||||
"_id": "updatePetWithForm"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"name": "Deletes a pet",
|
||||
"description": "",
|
||||
"url": "{{ base_url }}/pet/{{ petId }}",
|
||||
@@ -251,7 +251,7 @@
|
||||
"_id": "deletePet"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"name": "uploads an image",
|
||||
"description": "",
|
||||
"url": "{{ base_url }}/pet/{{ petId }}/uploadImage",
|
||||
@@ -291,7 +291,7 @@
|
||||
"_id": "uploadFile"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_2__",
|
||||
"parentId": "fld___WORKSPACE_ID__3a21295d",
|
||||
"name": "Returns pet inventories by status",
|
||||
"description": "Returns a map of status codes to quantities",
|
||||
"url": "{{ base_url }}/store/inventory",
|
||||
@@ -310,7 +310,7 @@
|
||||
"_id": "getInventory"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_2__",
|
||||
"parentId": "fld___WORKSPACE_ID__3a21295d",
|
||||
"name": "Place an order for a pet",
|
||||
"description": "",
|
||||
"url": "{{ base_url }}/store/order",
|
||||
@@ -323,7 +323,7 @@
|
||||
"_id": "placeOrder"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_2__",
|
||||
"parentId": "fld___WORKSPACE_ID__3a21295d",
|
||||
"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 }}",
|
||||
@@ -336,7 +336,7 @@
|
||||
"_id": "getOrderById"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_2__",
|
||||
"parentId": "fld___WORKSPACE_ID__3a21295d",
|
||||
"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 }}",
|
||||
@@ -349,7 +349,7 @@
|
||||
"_id": "deleteOrder"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"name": "Create user",
|
||||
"description": "This can only be done by the logged in user.",
|
||||
"url": "{{ base_url }}/user",
|
||||
@@ -362,7 +362,7 @@
|
||||
"_id": "createUser"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"name": "Creates list of users with given input array",
|
||||
"description": "",
|
||||
"url": "{{ base_url }}/user/createWithArray",
|
||||
@@ -375,7 +375,7 @@
|
||||
"_id": "createUsersWithArrayInput"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"name": "Creates list of users with given input array",
|
||||
"description": "",
|
||||
"url": "{{ base_url }}/user/createWithList",
|
||||
@@ -388,7 +388,7 @@
|
||||
"_id": "createUsersWithListInput"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"name": "Logs user into the system",
|
||||
"description": "",
|
||||
"url": "{{ base_url }}/user/login",
|
||||
@@ -412,7 +412,7 @@
|
||||
"_id": "loginUser"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"name": "Logs out current logged in user session",
|
||||
"description": "",
|
||||
"url": "{{ base_url }}/user/logout",
|
||||
@@ -425,7 +425,7 @@
|
||||
"_id": "logoutUser"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"name": "Get user by user name",
|
||||
"description": "",
|
||||
"url": "{{ base_url }}/user/{{ username }}",
|
||||
@@ -438,7 +438,7 @@
|
||||
"_id": "getUserByName"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"name": "Updated user",
|
||||
"description": "This can only be done by the logged in user.",
|
||||
"url": "{{ base_url }}/user/{{ username }}",
|
||||
@@ -451,7 +451,7 @@
|
||||
"_id": "updateUser"
|
||||
},
|
||||
{
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"name": "Delete user",
|
||||
"description": "This can only be done by the logged in user.",
|
||||
"url": "{{ base_url }}/user/{{ username }}",
|
||||
|
||||
+26
-26
@@ -12,7 +12,7 @@
|
||||
"parentId": null
|
||||
},
|
||||
{
|
||||
"_id": "__ENV_1__",
|
||||
"_id": "__BASE_ENVIRONMENT_ID__",
|
||||
"_type": "environment",
|
||||
"data": {
|
||||
"base_url": "{{ scheme }}://{{ host }}{{ base_path }}"
|
||||
@@ -21,7 +21,7 @@
|
||||
"parentId": "__WORKSPACE_ID__"
|
||||
},
|
||||
{
|
||||
"_id": "__ENV_2__",
|
||||
"_id": "env___BASE_ENVIRONMENT_ID___sub",
|
||||
"_type": "environment",
|
||||
"data": {
|
||||
"base_path": "/v2",
|
||||
@@ -29,10 +29,10 @@
|
||||
"scheme": "http"
|
||||
},
|
||||
"name": "Swagger env",
|
||||
"parentId": "__ENV_1__"
|
||||
"parentId": "__BASE_ENVIRONMENT_ID__"
|
||||
},
|
||||
{
|
||||
"_id": "__GRP_1__",
|
||||
"_id": "fld___WORKSPACE_ID__1b034c38",
|
||||
"_type": "request_group",
|
||||
"description": "Everything about your Pets",
|
||||
"environment": {},
|
||||
@@ -40,7 +40,7 @@
|
||||
"parentId": "__WORKSPACE_ID__"
|
||||
},
|
||||
{
|
||||
"_id": "__GRP_2__",
|
||||
"_id": "fld___WORKSPACE_ID__3a21295d",
|
||||
"_type": "request_group",
|
||||
"description": "Access to Petstore orders",
|
||||
"environment": {},
|
||||
@@ -48,7 +48,7 @@
|
||||
"parentId": "__WORKSPACE_ID__"
|
||||
},
|
||||
{
|
||||
"_id": "__GRP_3__",
|
||||
"_id": "fld___WORKSPACE_ID__12dea96f",
|
||||
"_type": "request_group",
|
||||
"description": "Operations about user",
|
||||
"environment": {},
|
||||
@@ -81,7 +81,7 @@
|
||||
"method": "POST",
|
||||
"name": "Add a new pet to the store",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"url": "{{ base_url }}/pet"
|
||||
},
|
||||
{
|
||||
@@ -110,7 +110,7 @@
|
||||
"method": "PUT",
|
||||
"name": "Update an existing pet",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"url": "{{ base_url }}/pet"
|
||||
},
|
||||
{
|
||||
@@ -136,7 +136,7 @@
|
||||
"value": "available"
|
||||
}
|
||||
],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"url": "{{ base_url }}/pet/findByStatus"
|
||||
},
|
||||
{
|
||||
@@ -162,7 +162,7 @@
|
||||
"value": "string"
|
||||
}
|
||||
],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"url": "{{ base_url }}/pet/findByTags"
|
||||
},
|
||||
{
|
||||
@@ -181,7 +181,7 @@
|
||||
"method": "GET",
|
||||
"name": "Find pet by ID",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"url": "{{ base_url }}/pet/{{ petId }}"
|
||||
},
|
||||
{
|
||||
@@ -221,7 +221,7 @@
|
||||
"method": "POST",
|
||||
"name": "Updates a pet in the store with form data",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"url": "{{ base_url }}/pet/{{ petId }}"
|
||||
},
|
||||
{
|
||||
@@ -247,7 +247,7 @@
|
||||
"method": "DELETE",
|
||||
"name": "Deletes a pet",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"url": "{{ base_url }}/pet/{{ petId }}"
|
||||
},
|
||||
{
|
||||
@@ -287,7 +287,7 @@
|
||||
"method": "POST",
|
||||
"name": "uploads an image",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__1b034c38",
|
||||
"url": "{{ base_url }}/pet/{{ petId }}/uploadImage"
|
||||
},
|
||||
{
|
||||
@@ -306,7 +306,7 @@
|
||||
"method": "GET",
|
||||
"name": "Returns pet inventories by status",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_2__",
|
||||
"parentId": "fld___WORKSPACE_ID__3a21295d",
|
||||
"url": "{{ base_url }}/store/inventory"
|
||||
},
|
||||
{
|
||||
@@ -319,7 +319,7 @@
|
||||
"method": "POST",
|
||||
"name": "Place an order for a pet",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_2__",
|
||||
"parentId": "fld___WORKSPACE_ID__3a21295d",
|
||||
"url": "{{ base_url }}/store/order"
|
||||
},
|
||||
{
|
||||
@@ -332,7 +332,7 @@
|
||||
"method": "GET",
|
||||
"name": "Find purchase order by ID",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_2__",
|
||||
"parentId": "fld___WORKSPACE_ID__3a21295d",
|
||||
"url": "{{ base_url }}/store/order/{{ orderId }}"
|
||||
},
|
||||
{
|
||||
@@ -345,7 +345,7 @@
|
||||
"method": "DELETE",
|
||||
"name": "Delete purchase order by ID",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_2__",
|
||||
"parentId": "fld___WORKSPACE_ID__3a21295d",
|
||||
"url": "{{ base_url }}/store/order/{{ orderId }}"
|
||||
},
|
||||
{
|
||||
@@ -358,7 +358,7 @@
|
||||
"method": "POST",
|
||||
"name": "Create user",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"url": "{{ base_url }}/user"
|
||||
},
|
||||
{
|
||||
@@ -371,7 +371,7 @@
|
||||
"method": "POST",
|
||||
"name": "Creates list of users with given input array",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"url": "{{ base_url }}/user/createWithArray"
|
||||
},
|
||||
{
|
||||
@@ -384,7 +384,7 @@
|
||||
"method": "POST",
|
||||
"name": "Creates list of users with given input array",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"url": "{{ base_url }}/user/createWithList"
|
||||
},
|
||||
{
|
||||
@@ -408,7 +408,7 @@
|
||||
"value": "string"
|
||||
}
|
||||
],
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"url": "{{ base_url }}/user/login"
|
||||
},
|
||||
{
|
||||
@@ -421,7 +421,7 @@
|
||||
"method": "GET",
|
||||
"name": "Logs out current logged in user session",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"url": "{{ base_url }}/user/logout"
|
||||
},
|
||||
{
|
||||
@@ -434,7 +434,7 @@
|
||||
"method": "GET",
|
||||
"name": "Get user by user name",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"url": "{{ base_url }}/user/{{ username }}"
|
||||
},
|
||||
{
|
||||
@@ -447,7 +447,7 @@
|
||||
"method": "PUT",
|
||||
"name": "Updated user",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"url": "{{ base_url }}/user/{{ username }}"
|
||||
},
|
||||
{
|
||||
@@ -460,7 +460,7 @@
|
||||
"method": "DELETE",
|
||||
"name": "Delete user",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_3__",
|
||||
"parentId": "fld___WORKSPACE_ID__12dea96f",
|
||||
"url": "{{ base_url }}/user/{{ username }}"
|
||||
}
|
||||
]
|
||||
|
||||
+8
-8
@@ -12,7 +12,7 @@
|
||||
"parentId": null
|
||||
},
|
||||
{
|
||||
"_id": "__ENV_1__",
|
||||
"_id": "__BASE_ENVIRONMENT_ID__",
|
||||
"_type": "environment",
|
||||
"data": {
|
||||
"base_url": "{{ scheme }}://{{ host }}{{ base_path }}"
|
||||
@@ -21,7 +21,7 @@
|
||||
"parentId": "__WORKSPACE_ID__"
|
||||
},
|
||||
{
|
||||
"_id": "__ENV_2__",
|
||||
"_id": "env___BASE_ENVIRONMENT_ID___sub",
|
||||
"_type": "environment",
|
||||
"data": {
|
||||
"base_path": "/v1",
|
||||
@@ -29,10 +29,10 @@
|
||||
"scheme": "http"
|
||||
},
|
||||
"name": "Swagger env",
|
||||
"parentId": "__ENV_1__"
|
||||
"parentId": "__BASE_ENVIRONMENT_ID__"
|
||||
},
|
||||
{
|
||||
"_id": "__GRP_1__",
|
||||
"_id": "fld___WORKSPACE_ID__a8acce24",
|
||||
"_type": "request_group",
|
||||
"description": "",
|
||||
"environment": {},
|
||||
@@ -55,7 +55,7 @@
|
||||
"value": "0"
|
||||
}
|
||||
],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__a8acce24",
|
||||
"url": "{{ base_url }}/pets"
|
||||
},
|
||||
{
|
||||
@@ -77,7 +77,7 @@
|
||||
"method": "POST",
|
||||
"name": "Create a pet",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__a8acce24",
|
||||
"url": "{{ base_url }}/pets"
|
||||
},
|
||||
{
|
||||
@@ -90,7 +90,7 @@
|
||||
"method": "GET",
|
||||
"name": "Info for a specific pet",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__a8acce24",
|
||||
"url": "{{ base_url }}/pets/{{ petId }}"
|
||||
},
|
||||
{
|
||||
@@ -118,7 +118,7 @@
|
||||
"method": "POST",
|
||||
"name": "Update specific pet",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__a8acce24",
|
||||
"url": "{{ base_url }}/pets/{{ petId }}"
|
||||
}
|
||||
]
|
||||
|
||||
+7
-7
@@ -12,7 +12,7 @@
|
||||
"parentId": null
|
||||
},
|
||||
{
|
||||
"_id": "__ENV_1__",
|
||||
"_id": "__BASE_ENVIRONMENT_ID__",
|
||||
"_type": "environment",
|
||||
"data": {
|
||||
"base_url": "{{ scheme }}://{{ host }}{{ base_path }}"
|
||||
@@ -21,7 +21,7 @@
|
||||
"parentId": "__WORKSPACE_ID__"
|
||||
},
|
||||
{
|
||||
"_id": "__ENV_2__",
|
||||
"_id": "env___BASE_ENVIRONMENT_ID___sub",
|
||||
"_type": "environment",
|
||||
"data": {
|
||||
"base_path": "/v1",
|
||||
@@ -29,10 +29,10 @@
|
||||
"scheme": "http"
|
||||
},
|
||||
"name": "Swagger env",
|
||||
"parentId": "__ENV_1__"
|
||||
"parentId": "__BASE_ENVIRONMENT_ID__"
|
||||
},
|
||||
{
|
||||
"_id": "__GRP_1__",
|
||||
"_id": "fld___WORKSPACE_ID__a8acce24",
|
||||
"_type": "request_group",
|
||||
"description": "Everything about your Pets",
|
||||
"environment": {},
|
||||
@@ -55,7 +55,7 @@
|
||||
"value": "0"
|
||||
}
|
||||
],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__a8acce24",
|
||||
"url": "{{ base_url }}/pets"
|
||||
},
|
||||
{
|
||||
@@ -68,7 +68,7 @@
|
||||
"method": "POST",
|
||||
"name": "Create a pet",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__a8acce24",
|
||||
"url": "{{ base_url }}/pets"
|
||||
},
|
||||
{
|
||||
@@ -81,7 +81,7 @@
|
||||
"method": "GET",
|
||||
"name": "Info for a specific pet",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__a8acce24",
|
||||
"url": "{{ base_url }}/pets/{{ petId }}"
|
||||
}
|
||||
]
|
||||
|
||||
+5
-5
@@ -12,7 +12,7 @@
|
||||
"parentId": null
|
||||
},
|
||||
{
|
||||
"_id": "__ENV_1__",
|
||||
"_id": "__BASE_ENVIRONMENT_ID__",
|
||||
"_type": "environment",
|
||||
"data": {
|
||||
"base_url": "{{ scheme }}://{{ host }}{{ base_path }}"
|
||||
@@ -21,7 +21,7 @@
|
||||
"parentId": "__WORKSPACE_ID__"
|
||||
},
|
||||
{
|
||||
"_id": "__ENV_2__",
|
||||
"_id": "env___BASE_ENVIRONMENT_ID___sub",
|
||||
"_type": "environment",
|
||||
"data": {
|
||||
"base_path": "",
|
||||
@@ -29,10 +29,10 @@
|
||||
"scheme": "http"
|
||||
},
|
||||
"name": "Swagger env",
|
||||
"parentId": "__ENV_1__"
|
||||
"parentId": "__BASE_ENVIRONMENT_ID__"
|
||||
},
|
||||
{
|
||||
"_id": "__GRP_1__",
|
||||
"_id": "fld___WORKSPACE_ID__e214b8a2",
|
||||
"_type": "request_group",
|
||||
"description": "",
|
||||
"environment": {},
|
||||
@@ -49,7 +49,7 @@
|
||||
"method": "GET",
|
||||
"name": "Some list",
|
||||
"parameters": [],
|
||||
"parentId": "__GRP_1__",
|
||||
"parentId": "fld___WORKSPACE_ID__e214b8a2",
|
||||
"url": "{{ base_url }}/api/list"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
const SwaggerParser = require('swagger-parser');
|
||||
const utils = require('../utils');
|
||||
'use strict';
|
||||
|
||||
const crypto = require('crypto');
|
||||
const utils = require('../utils');
|
||||
const SwaggerParser = require('swagger-parser');
|
||||
const SUPPORTED_SWAGGER_VERSION = '2.0';
|
||||
const MIMETYPE_JSON = 'application/json';
|
||||
const MIMETYPE_URLENCODED = 'application/x-www-form-urlencoded';
|
||||
@@ -9,7 +11,6 @@ const SUPPORTED_MIME_TYPES = [MIMETYPE_JSON, MIMETYPE_URLENCODED, MIMETYPE_MULTI
|
||||
const WORKSPACE_ID = '__WORKSPACE_ID__';
|
||||
|
||||
let requestCount = 1;
|
||||
let requestGroupCount = 1;
|
||||
|
||||
module.exports.id = 'swagger2';
|
||||
module.exports.name = 'Swagger 2.0';
|
||||
@@ -17,7 +18,6 @@ module.exports.description = 'Importer for Swagger 2.0 specification (json/yaml)
|
||||
|
||||
module.exports.convert = async function(rawData) {
|
||||
requestCount = 1;
|
||||
requestGroupCount = 1;
|
||||
|
||||
// Validate
|
||||
let api = await parseDocument(rawData);
|
||||
@@ -45,7 +45,7 @@ module.exports.convert = async function(rawData) {
|
||||
|
||||
const baseEnv = {
|
||||
_type: 'environment',
|
||||
_id: '__ENV_1__',
|
||||
_id: '__BASE_ENVIRONMENT_ID__',
|
||||
parentId: WORKSPACE_ID,
|
||||
name: 'Base environment',
|
||||
data: {
|
||||
@@ -55,7 +55,7 @@ module.exports.convert = async function(rawData) {
|
||||
|
||||
const swaggerEnv = {
|
||||
_type: 'environment',
|
||||
_id: '__ENV_2__',
|
||||
_id: 'env___BASE_ENVIRONMENT_ID___sub',
|
||||
parentId: baseEnv._id,
|
||||
name: 'Swagger env',
|
||||
data: {
|
||||
@@ -156,9 +156,14 @@ function parseEndpoints(document) {
|
||||
* @returns {Object}
|
||||
*/
|
||||
function importFolderItem(item, parentId) {
|
||||
const hash = crypto
|
||||
.createHash('sha1')
|
||||
.update(item.name)
|
||||
.digest('hex')
|
||||
.slice(0, 8);
|
||||
return {
|
||||
parentId,
|
||||
_id: `__GRP_${requestGroupCount++}__`,
|
||||
_id: `fld___WORKSPACE_ID__${hash}`,
|
||||
_type: 'request_group',
|
||||
name: item.name || 'Folder {requestGroupCount}',
|
||||
description: item.description || '',
|
||||
|
||||
Reference in new issue
Block a user