Julien-cpsn / ATAC

A simple API client (postman like) in your terminal
https://atac.julien-cpsn.com/
MIT License
2.02k stars 86 forks source link

JSON parsing error when importing postman collection #83

Closed Bettehem closed 4 months ago

Bettehem commented 4 months ago

Hello. I was looking for a TUI alternative for Postman and I'm glad I found this awesome project.

I'm having some issues though. I'd like to import my collections from Postman to ATAC, but while the feature matrix lists Collection v2.1.0 as supported, I get the following error whenever trying to import the .json file:

Error:
        Could not parse JSON collection
        missing field name at line 914 column 1

I attached the json file here: SoundCloud Web API.postman_collection.json

I'm suspecting it may be that the variables aren't handled properly?

Julien-cpsn commented 4 months ago

Hello @Bettehem!

Great that you like the tool :)

hmmm, when trying it succeed first time haha. Soo I don't especially know what the problem may be Which version of ATAC are you using? Mine's v0.15.1 (latest)

cargo run -- -d base_collections import postman import_tests/SoundCloud.Web.API.postman_collection.json --dry-run

# Or this one (if you have the ATAC_MAIN_DIR env variable set, and do not need a dry-run)
atac import postman import_tests/SoundCloud.Web.API.postman_collection.json

image

Also, note that no mechanism for importing variables from Postman collections is existing right now. Thought, it should not block importing the collection if the key is present.

Have a great day

Bettehem commented 4 months ago

Hi, thanks for your help. It seems like I was previously setting the -d argument incorrectly and that was causing the error. Now that i corrected it, the json was imported successfully!

Julien-cpsn commented 4 months ago

@Bettehem here is the doc for env variables https://atac.julien-cpsn.com/docs/features/environment-variables

It's very WIP yet, but it might help you