Skip to content

docs: document the new validateInstance API#135

Open
mttrbrts wants to merge 1 commit into
mainfrom
docs/ergonomic-validation-api
Open

docs: document the new validateInstance API#135
mttrbrts wants to merge 1 commit into
mainfrom
docs/ergonomic-validation-api

Conversation

@mttrbrts
Copy link
Copy Markdown
Member

Summary

Updates the "Validating Data" page to lead with the ergonomic validateInstance API added in accordproject/concerto#1240, while keeping the existing Serializer.fromJSON example as a lower-level alternative.

The new page covers:

  • validateInstance / validateInstanceOrThrow / isValidInstance on both ModelManager and ClassDeclaration
  • The discriminated ValidationResult shape and the Diagnostic type
  • A reference table of stable diagnostic codes (MISSING_REQUIRED_FIELD, TYPE_MISMATCH, VALIDATOR_VIOLATION, etc.)
  • The aggregation contract (all post-deserialization violations are collected; pre-deserialization failures still produce a single DESERIALIZATION_ERROR)
  • generateSample() for round-trippable sample data
  • A worked example: grouping diagnostics by JSON-pointer path for form-style error rendering

Test plan

…odelManager

Rewrites the "Validating Data" page to lead with the ergonomic
validateInstance / validateInstanceOrThrow / isValidInstance trio added in
accordproject/concerto#1240, with diagnostic shape, codes table, aggregation
contract, and a form-validation worked example. Keeps the existing
Serializer.fromJSON example as the lower-level alternative.

Signed-off-by: Matt Roberts <code@rbrts.uk>
@netlify
Copy link
Copy Markdown

netlify Bot commented May 25, 2026

Deploy Preview for concerto-docs ready!

Name Link
🔨 Latest commit 890508b
🔍 Latest deploy log https://app.netlify.com/projects/concerto-docs/deploys/6a14a9a3fd384c0008f1166f
😎 Deploy Preview https://deploy-preview-135--concerto-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant