All YAML-based Multimeter files can import data from .json, .yaml, .yml, and .csv files with a top-level import map.
Markdown (no JavaScript)
# Data Imports All YAML-based Multimeter files can import data from `.json`, `.yaml`, `.yml`, and `.csv` files with a top-level `import` map. For **data-driven test loops** (CSV rows, `${alias.field}` in `for` steps), see [Data-driven tests](./data-driven-tests.md) — that is the primary guide for test files. ```yaml type: api import: fixture: ./data/user.json url: https://test.mmt.dev/echo/${fixture.user.id} method: post body: ${fixture.payload} ``` Each import key is an alias. The value is a path relative to the current `.mmt` file, or a project-root path starting with `+/` relative to the folder containing `multimeter.mmt`. Imported values are referenced with `${alias.path}`. A whole scalar value like `body: ${fixture.payload}` keeps the imported value's type, so objects stay objects and arrays stay arrays. Inline replacements inside longer strings are converted to text. CSV imports are parsed into JSON rows, using the same behavior as test CSV imports: quoted fields are preserved as strings, unquoted numbers and booleans are coerced, and BOMs/quoted commas are handled. Example JSON `file:` ```json { "endpoint": "users", "payload": { "name": "Alice", "active": true } } ``` Example YAML `file:` ```yaml endpoint: users payload: name: Alice active: true ``` Both can be used the same way: ```yaml import: data: ./fixture.yaml url: https://test.mmt.dev/${data.endpoint} body: ${data.payload} ``` Supported file types include `api`, `test`, `suite`, `loadtest`, `env`, `doc`, and `server`. --- ## See also - [Data-driven tests](./data-driven-tests.md) — CSV loops and test-focused patterns - [CSV data-driven test example](../../examples/intermediate/09_csv_data_driven_test/README.md) — full CSV loop example - [import](../files/test/import.md) — importable file types in tests
For AI agents · llms.txt · Home