GuitarPrometheus::Profiles::ProfileValidator
GuitarPrometheus::Profiles::ProfileValidator
Validates a parsed JSON value against the v1 Profile schema and builds a [Profile](/api-reference/classes/classguitarprometheus_1_1profiles_1_1profile/) with sanitized field values, producing a list of [ProfileIssue](/api-reference/classes/structguitarprometheus_1_1profiles_1_1profileissue/)s describing everything that was adjusted. More…
#include <ProfileValidator.h>
Public Classes
| Name | |
|---|---|
| struct | Result |
Public Functions
| Name | |
|---|---|
| Result | validateAndBuild(const nlohmann::json & parsed, const std::optional< juce::File > & sourceFile) Validate and build. |
Detailed Description
class GuitarPrometheus::Profiles::ProfileValidator;Validates a parsed JSON value against the v1 Profile schema and builds a [Profile](/api-reference/classes/classguitarprometheus_1_1profiles_1_1profile/) with sanitized field values, producing a list of [ProfileIssue](/api-reference/classes/structguitarprometheus_1_1profiles_1_1profileissue/)s describing everything that was adjusted.
Sanitization policy:
- Errors: structural failures only (non-object root, unknown schemaVersion). Profile is nullopt; load aborts.
- Warnings: every field-level sanitization. Profile loads with corrected values.
See the Phase 4 design document for the complete sanitization table.
Public Functions Documentation
function validateAndBuild
static Result validateAndBuild( const nlohmann::json & parsed, const std::optional< juce::File > & sourceFile)Validate and build.
Parameters:
- parsed A parsed JSON value (from
nlohmann::json::parse). - sourceFile File the JSON came from; stamped onto every emitted ProfileIssue.
nulloptfor clipboard paste or in-memory validation.
Updated on 2026-05-29 at 07:39:52 +0000