usebruno · GitHub

Hi @rabestro

Today, we support Bru lang. Support for using yaml / toml while parsing the lang are on the roadmap

Why Bru ?

As one of the advantages of Bruno is that the entire collection is able to be treated as a git repository, having contextually standard key order as well as a relatively compact textual representation is a huge benefit, and that's something that the "big 3" formats (json, yaml, toml) cannot viably provide, but a custom language as is already used can. - @halostatue

Below I am picking an example to explain these nuances

In Bruno UI, you can save duplicate key val pairs. Ex: below use case is perfectly valid

image

We also need to store whether the value is disabled or not.
And we will support storing descriptions in the future (for all keyval pairs in Bruno like headers, params, vars ...)

So in bru it would be like

http:
  params: {
    query: {
      userId: 1
      userId: 2
      @description('whether the user is active or not')
      status: active
      @disabled
      page: 1
    }
  }

Where as in yaml it would be like.

http:
  params:
    query:
      -
        key: userId
        value: 1
      -
        key: userId
        value: 2
      -
        key: status
        value: active
        description: whether the user is active or not
      -
        key: page
        value: 1
        disabled: true

Lets take another example with headers

http: {
  headers: {
    Content-Type: application/json
    Authorization: 'Bearer: {{token}}'
    Accept-Encoding: gzip, deflate, br
    Accept-Language: en-US,en;q=0.9
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko)
  }
}

Same thing in yaml

http:
  headers:
    -
      key: Content-Type
      value: application/json
    -
      key: Authorization
      value: 'Bearer: {{token}}'
    -
      key: Accept-Encoding
      value: gzip, deflate, br
    -
      key: Accept-Language
      value: en-US,en;q=0.9
    -
      key: User-Agent
      value: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko)

Read the original on github.com ↗