1.0 KiB
Variables
Variables in Stoplight provide a powerful and intuitive way to allow you to dynamically set, update, and retrieve information at any step in a Scenario. Variables can be used in many different ways, however the two primary methods for using variable data is through:
-
Environments - Variables can be persisted in the environment configuration, allowing data to be automatically populated depending on the editor's environment. See here for more information on how to use variables in an environment.
-
Contexts - Variables can be stored in a scenario "context", allowing for test and application state to be persisted between scenario steps. See here for more information on how to use variables in a scenario context.
Variables can be used to modify both request and response objects, including URL's, headers, the request/response body, and more.
Related