Class BowireProjectFile

Namespace
Kuestenlogik.Bowire.Projects
Assembly
Kuestenlogik.Bowire.dll

The checked-in .bowire/project.json convention (#172): a version-controlled MANIFEST that makes a repository the source of truth for "what this repo's API looks like". It does not carry the artifacts itself — it POINTS at them (schemas, collection/suite files, an auth flow, a rules file) with project-relative paths, so CI, the PR bot, and onboarding all resolve the same setup automatically instead of re-configuring per job.

public sealed class BowireProjectFile
Inheritance
BowireProjectFile
Inherited Members

Remarks

Parsing mirrors AuthRecording: Parse(string?) throws JsonException on malformed JSON or an unknown field, and ArgumentException on a shape violation (a missing version). Softer, actionable checks — an unsupported version, an absolute path where a project-relative one is expected, an empty source URL — are surfaced by Validate() as a list of messages so a caller can report every problem at once rather than one-throw-at-a-time. No network access: the hosted $schema (SchemaUrl) is never fetched.

Constructors

BowireProjectFile()

public BowireProjectFile()

Fields

SchemaUrl

Canonical served URL of the published JSON Schema for this manifest — the value writers emit as $schema so an editor can offer completion/validation. Matches the $id of site/schemas/project.v1.json and the served convention the sidecar schema uses (bowire.io/schemas/…). Never fetched at load.

public const string SchemaUrl = "https://bowire.io/schemas/project.v1.json"

Field Value

string

StorageProject

Manifest value selecting project-local storage.

public const string StorageProject = "project"

Field Value

string

StorageUser

Manifest value selecting the machine-wide user profile (the default).

public const string StorageUser = "user"

Field Value

string

SupportedVersion

The current (and only) supported manifest version.

public const int SupportedVersion = 1

Field Value

int

Properties

Name

Human project name (e.g. order-service). Optional.

[JsonPropertyName("name")]
public string? Name { get; set; }

Property Value

string

Rules

Project-relative path to a rules file. Optional.

[JsonPropertyName("rules")]
public string? Rules { get; set; }

Property Value

string

Schema

Optional JSON-Schema hint (https://bowire.io/schemas/project.v1.json). Never fetched.

[JsonPropertyName("$schema")]
public string? Schema { get; set; }

Property Value

string

Security

Security configuration — the auth flow to run and the scan profiles to apply.

[JsonPropertyName("security")]
public BowireProjectSecurity? Security { get; set; }

Property Value

BowireProjectSecurity

Sources

The API sources this project exposes — each a base URL plus zero or more schema files.

[JsonPropertyName("sources")]
public List<BowireProjectSource> Sources { get; init; }

Property Value

List<BowireProjectSource>

Storage

Where this project's collections, environments, recordings and presets live: "user" (the default — ~/.bowire/, shared across every workspace on the machine) or "project" (this repo's .bowire/ directory, so the data travels with the checkout).

public string? Storage { get; set; }

Property Value

string

Remarks

Opt-in on purpose (#591). Rooting storage at the project the moment a manifest exists would silently relocate the data of everyone who already uses .bowire/project.json for sources and rules — their collections would appear to vanish. One line in the manifest is a small price for nobody being surprised.

This is a property of the REPO, not of whoever launched Bowire, which is what makes it work the same from the CLI, the standalone tool and an IDE extension without any per-surface wiring. The working directory has never had a say in it — that assumption is precisely what made #101's "collections travel with the repo" claim false for months.

Suites

Named test suites/collections, keyed by a short id (e.g. smoke), each a project-relative path.

[JsonPropertyName("suites")]
public Dictionary<string, string> Suites { get; init; }

Property Value

Dictionary<string, string>

UsesProjectStorage

True when this manifest asks for its data to live beside the code. Absent / "user" both mean the machine-wide default.

public bool UsesProjectStorage { get; }

Property Value

bool

Version

Manifest schema version. Required; must be SupportedVersion.

[JsonPropertyName("version")]
public int? Version { get; set; }

Property Value

int?

Methods

Parse(string?)

Parse a manifest document. Throws JsonException when the payload is not a JSON object of the expected shape (malformed JSON, a type mismatch, or an unknown field), and ArgumentException on a shape violation the serializer can't express — a missing version. Softer validity questions belong to Validate().

public static BowireProjectFile Parse(string? json)

Parameters

json string

Returns

BowireProjectFile

ToJson()

Serialize to the canonical on-disk JSON shape.

public string ToJson()

Returns

string

Validate()

Run the softer, non-fatal schema checks and return one actionable message per problem (empty when the manifest is valid). Each message names the offending field and what's wrong. Called after a successful Parse(string?), so version is guaranteed non-null here.

public IReadOnlyList<string> Validate()

Returns

IReadOnlyList<string>