subasraj / flashpost-support

Flashpost is a lightweight Rest API Client Extension for Visual Studio Code.
MIT License
10 stars 0 forks source link

Import Collection from Thunder Client Issues #1

Closed SxMShaDoW closed 10 months ago

SxMShaDoW commented 10 months ago

Hi,

When I try to import the tc_col_XXXX.json from Thunder Client to Flashpost - I get an "Could not import the collection - Invalid Data".

Structure of the JSON looks as followed:

    "_id": "58808fd6-e2de-4c5a-9ba4-e6e3fc7e7b4b",
    "colName": "String",
    "created": "2023-02-20T22:57:36.172Z",
    "sortNum": 10000,
    "folders": [
        {
            "_id": "f588948d-e015-4506-ae9e-e1165d11fbbe",
            "name": "AAA",
            "containerId": "",
            "created": "2023-10-20T13:39:58.412Z",
            "sortNum": 20000
        },
        {
            "_id": "03ba0f83-fc20-4ca3-85ba-bbe84b62dda1",
            "name": "Widgets",
            "containerId": "",
            "created": "2023-10-23T16:24:27.466Z",
            "sortNum": 30000
        }
    ], "requests": [
        {
            "_id": "607952ad-0ac4-44ce-b6e1-492d7b4f9c75",
            "colId": "58808fd6-e2de-4c5a-9ba4-e6e3fc7e7b4b",
            "containerId": "f588948d-e015-4506-ae9e-e1165d11fbbe",
            "name": "XXXX ",
            "url": "XXXX/YYYYY",
            "method": "POST",
            "sortNum": 10000,
            "created": "2023-02-20T22:57:36.174Z",
            "modified": "2023-02-20T22:57:36.174Z",
            "headers": [],
            "params": [],
            "body": {
                "type": "json",
                "raw": "{\n  \"AAAA\": \"test2\"\n}",
                "form": []
            },
            "auth": {
                "type": "basic",
                "basic": {
                    "username": "xxxx",
                    "password": "xxxx"
                }
            },
            "tests": []
        },
        {...},
        {...}
        ]
subasraj commented 10 months ago

Hi I will check on this when i get a chance Thanks Subas

subasraj commented 10 months ago

Hi, There is no issue with the code. please try the attached file thunder-collection_test1.json

subasraj commented 10 months ago

Closing this issue

SxMShaDoW commented 10 months ago

Thanks for providing the example!

So it looks like I wasn't exporting it correctly then. When I added the below to my JSON it worked (I believe in mine I was pulling it directly from the collections on the filesystem):

    "client": "Thunder Client",
    "collectionName": "XXXX",
    "dateExported": "2023-10-23T16:23:57.011Z",
    "version": "1.1"