Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support the input file format to YAML #30

Closed
rabin-io opened this issue Apr 18, 2024 · 7 comments · Fixed by #63
Closed

Support the input file format to YAML #30

rabin-io opened this issue Apr 18, 2024 · 7 comments · Fixed by #63

Comments

@rabin-io
Copy link

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 :)

@Julien-cpsn
Copy link
Owner

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

@rabin-io
Copy link
Author

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

@ccoVeille
Copy link
Contributor

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

@Julien-cpsn
Copy link
Owner

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

@Julien-cpsn
Copy link
Owner

@rabin-io @ccoVeille

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

@ccoVeille
Copy link
Contributor

Thanks

@rabin-io
Copy link
Author

rabin-io commented May 4, 2024

+1 Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants