Open
Description
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.