Skip to content

Global Variables #265

Open
Open
@camilamaia

Description

@camilamaia

Global Variables

Enable the possibility to have global variables. Sometimes we need to access a variable from outside the scope, for example:

endpoints:
  - name: owner
    headers:
      Authorization: ${OWNER_TOKEN}
    requests:
      - name: register a book
        path: register/book
        method: post
        body:
          title: My Little Book
          author: John P.
        vars:
          book_id: ${{ request.json()["data"]["id"] }}
      - ...
      - ...
  - name: client
    headers:
      Authorization: ${CLIENT_TOKEN}
    requests:
      - name: rent a book
        path: rent/book/${book_id}
        method: POST
      - ...
      - ...

It would be nice to have a way to store book_id globally. Currently, the example above wouldn't work because the second request is not in the same scope as the first one.

Metadata

Metadata

Assignees

Labels

FeatureNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions