ATAC icon indicating copy to clipboard operation
ATAC copied to clipboard

Support the input file format to YAML

Open rabin-io opened this issue 1 year ago • 2 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 :)

rabin-io avatar Apr 18 '24 15:04 rabin-io

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

Julien-cpsn avatar Apr 18 '24 15:04 Julien-cpsn

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

rabin-io avatar Apr 18 '24 23:04 rabin-io

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

ccoVeille avatar Apr 19 '24 05:04 ccoVeille

You are right here https://github.com/Julien-cpsn/ATAC/commit/950ed65b62854c52bb69af7dae4c3161310452dd#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

Julien-cpsn avatar Apr 19 '24 08:04 Julien-cpsn

@rabin-io @ccoVeille

Here you go https://github.com/Julien-cpsn/ATAC/releases/tag/v0.15.1

Julien-cpsn avatar May 03 '24 10:05 Julien-cpsn

Thanks

ccoVeille avatar May 03 '24 10:05 ccoVeille

+1 Thanks

rabin-io avatar May 04 '24 20:05 rabin-io