Skip to main content
Version: 1.2.0

JSONL Reader

The JSONL reader is the default reader. It reads requirements from JSON Lines (.jsonl) files stored on disk. No extra dependencies are required.

When to use: Your requirements are exported or generated as .jsonl files, or you want the simplest setup with no external dependencies.

Installation

No extra dependencies required; it is included in the base package.

Setup

  1. Create a root directory for your requirements (e.g. requirements/jsonl/).
  2. Inside it, create one subdirectory per project.
  3. Place one or more .jsonl baseline files inside each project directory.
  4. Place a UserDefinedAttributes.json file at the top level of the requirements directory.

Directory layout example:

requirements/jsonl/
├── UserDefinedAttributes.json
├── ProjectA/
│ ├── Baseline_v1.jsonl
│ └── Baseline_v2.jsonl
└── ProjectB/
└── Release_1.0.jsonl

Configuration

The configuration can be added directly to config.toml under [testbench-requirement-service.reader_config] (recommended) or in a separate .toml file without a section prefix.

Configuration settings

SettingTypeDescriptionRequiredDefault
requirements_pathStringPath to the directory containing the requirement filesYes(none)

Minimal configuration

# config.toml
[testbench-requirement-service]
reader_class = "JsonlRequirementReader"

[testbench-requirement-service.reader_config]
requirements_path = "requirements/jsonl/"

Or use a separate reader config file:

# config.toml
[testbench-requirement-service]
reader_class = "JsonlRequirementReader"
reader_config_path = "reader_config.toml"
# reader_config.toml
requirements_path = "requirements/jsonl/"

Required data layout

ConceptLocationDescription
ProjectsTop-level directories inside requirements_pathEach directory is a project
Baselines.jsonl files inside a project directoryEach file is a baseline
RequirementsJSON objects (one per line) in a .jsonl fileEach line is a requirement or folder node
User-defined attributesUserDefinedAttributes.json at the top of requirements_pathDefines available types of user defined fields (UDF)

Requirement JSON schema

Each line in a baseline .jsonl file is a JSON object representing either a requirement or a structural node (folder/group).

  • If "requirement" is true → the object is an actual requirement.
  • If "requirement" is false → the object is a folder/group in the tree.
  • Root objects have "parent" set to null.
{
"name": "string",
"extendedID": "string",
"key": {
"id": "string",
"version": {
"name": "string",
"date": "string <date-time>",
"author": "string",
"comment": "string"
}
},
"owner": "string",
"status": "string",
"priority": "string",
"requirement": true,
"description": "string",
"documents": ["string"],
"parent": "string | null",
"userDefinedAttributes": [
{
"name": "string",
"valueType": "STRING | ARRAY | BOOLEAN",
"stringValue": "string",
"stringValues": ["string"],
"booleanValue": true
}
]
}

Fields reference

FieldTypeDescription
nameStringRequirement name
extendedIDStringExtended ID
key.idStringUnique identifier
key.versionObjectVersion info: name, date, author, comment
ownerStringResponsible person
statusStringRequirement status
priorityStringPriority level
requirementBooleantrue = requirement, false = folder/group
descriptionStringRequirement description
documentsList[String]Attached document references
parentString or nullParent node ID (null for roots)
userDefinedAttributesList[Object]User-defined fields (see below)

UserDefinedAttributes.json

This file at the top level of requirements_path defines which UDFs exist and their value types:

[
{ "name": "Risk", "valueType": "STRING" },
{ "name": "Units", "valueType": "ARRAY" },
{ "name": "In Scope", "valueType": "BOOLEAN" }
]

Supported valueType values: STRING, ARRAY, BOOLEAN.

Testing

Smoke test

  1. Start the server:

    testbench-requirement-service start
  2. Call the projects endpoint:

    curl -u "ADMIN_USERNAME:PASSWORD" http://127.0.0.1:8020/projects
  3. Verify that your project directories are listed in the response.

Troubleshooting

ProblemCauseSolution
Empty project listWrong requirements_pathCheck that the path exists and contains project subdirectories.
500 error on baselinesMissing UserDefinedAttributes.jsonCreate the file at the top level of requirements_path.
Malformed responseInvalid JSONLVerify that each line is valid JSON matching the required schema.