Julien-cpsn / ATAC

A simple API client (postman like) in your terminal

Home Page:https://atac.julien-cpsn.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support the input file format to YAML

rabin-io opened this issue · comments

Just a suggestion, can you add support for yaml as the input for the collection, yaml is more human friendly, for read and write. You can also have references (anchors) to reduce repetitive blocks.

Just a thought :)

Hello!

I personnally really do not like (hate) Yaml files. In contexts where you can have tabulated or big text it's by far one of the most unpractical things (e.g. request body).

I am not closed to the idea though

Have a great day

YAML and JSON are pretty much interchangeable, but YAML do have some benefits over JSON when it comes to human-readable (and editing).

Take the file auth.json for example, it can be written almost half of the length. Which I find much easier to skim with the eyes, without all the extra fluff of JSON with quotes and curly braces.

---
name: Auth
requests:
- name: Test Basic Auth
  url: https://httpbin.org/basic-auth/username/pwd
  method: GET
  params: []
  headers: &default_headers
  - enabled: true
    data:
    - cache-control
    - no-cache
  - enabled: true
    data:
    - user-agent
    - ATAC/v0.7.0
  - enabled: true
    data:
    - accept
    - "*/*"
  - enabled: true
    data:
    - accept-encoding
    - gzip, deflate, br
  - enabled: true
    data:
    - connection
    - keep-alive
  body: no_body
  auth:
    basic_auth:
    - username
    - password
  settings: &default_settings
    use_config_proxy: true
    allow_redirects: true
    store_received_cookies: true
    pretty_print_response_content: true
- name: Test Bearer Auth
  url: https://httpbin.org/bearer
  method: GET
  params: []
  headers:
  <<: *default_headers
  body: no_body
  auth:
    bearer_token: my_bearer=
  settings:
    <<: *default_settings

I second the idea that supporting yaml would be a great thing

You are right here 950ed65#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R215
I'll let the issue open in order for people to debate. In case "everyone" agrees, it will probably be implemented. But just to let you know it will probably be very low in the priority list

Thanks

+1 Thanks