As-code YAML format

An as-code project is a set of YAML files that describe your servers, user paths, populations, and scenarios. The schema defines what a project may contain. The NeoLoad command-line interface (CLI) enforces it and rejects anything outside it before a single request goes out.

This topic covers the rules that shape a project. For the element-by-element detail, read the schema itself in the neoload-models repository (opens in new tab), which is the authoritative source. The as-code format covers a subset of what the project format of NeoLoad, the desktop application, supports. To see which features the as-code format supports, check the feature coverage reference (opens in new tab), which lists each functional area and the schema version that supports it.

The project root

The file you pass to the CLI sets the project root: its parent directory. Assets that the project reads, such as CSV files, must sit under that root, because the engine copies the root when it runs.

By convention, the entry file is default.yaml. Keep it in your repository next to the application it tests, and version it the same way.

Declare the schema version

Every project states the schema it targets, as a quoted string:

Copy
schemaVersion: "3.1"

The elements sit at the top level of the file underneath it. If the schema the CLI checks against doesn't match the version you declared, the CLI rejects a correct file. In that case, pass the matching schema with -s.

Enable editor autocompletion

Editors such as IntelliJ, or Visual Studio Code with the YAML extension, can read the schema directly. This gives you autocompletion, inline documentation, and errors as you type. Add a $schema line above schemaVersion:

Copy
$schema: https://raw.githubusercontent.com/Neotys-Labs/neoload-models/refs/heads/v3/schemas/v3.1/as-code.schema.json
schemaVersion: "3.1"

Your editor reads $schema; the CLI reads schemaVersion. The line is optional, and it doesn't change how the CLI validates your project.

Split a project across files

Use include to pull other YAML files into the entry file. Put user paths, populations, and scenarios in separate files. That way, each file stays small enough to review on its own when the project goes through code review like the rest of your repository.

Mistakes the schema catches

The following errors account for most rejected files, and all are easy to write by hand or to generate from memory:

Instead of

Write

think_time: 3s

think_time: "3000". Think times are milliseconds, written as a quoted string.

A flat list of request entries

Requests nested inside an http_page or a transaction.

A project key at the root

Nothing. There's no root project key in the schema.

Validate the syntax

To check only the syntax of your project, use neoload validate. It doesn't contact your application, so it answers instantly. This step is optional, because NeoLoad CheckVU runs the same validation every time you check the user paths. Run the following command:

Copy
neoload validate default.yaml

A correct file reports Yaml file is valid.

What's next

Once the file passes validation, run NeoLoad CheckVU to prove that your user paths run against your application.