agrostar / zzapi-vscode

VS Code extension for zzapi - an API testing and documentation framework
MIT License
3 stars 0 forks source link

Ability to convert request URI or cURL request to zzAPI request #23

Closed vasansr closed 3 months ago

vasansr commented 3 months ago

I find myself often pasting the contents of a request from, say nginx logs or when someone sends me the cURL request.

Example:

/catalogservice/v3/productwarehouseinventory/?skuCodes=AGS-AV-001,AGS-CP-1227,AGS-CP-1228,AGS-S-4509&facilityCode=JDH01

It would be nice if I could just paste this, select the text, right click on the text and convert it to a GET request.

Or a cURL request in toto:

curl 'https://example.com/service/v3/endpoint/?userId=573236' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'source: B2BUP' \
  -H 'x-authorization-token: XXXX

POST requests are going to be hard to deconstruct, plus I don't usually feel the need for this in POST requests.

Varun0157 commented 3 months ago

For curl requests, we'll have to look into adding another dependency to parse it right? curlconverter seems widely used for this. For regular URI's we can probably use node's in built url module.

vasansr commented 3 months ago

With the curlconverter and the jsontoyaml extension I am able to do this (though it takes two steps). I think this will suffice. Let us not implement the same in zzAPI.