JSON Schema
GET /neowiki/v0/schema/{schemaName}/json-schema serves a Schema as a self-contained JSON Schema draft 2020-12 document (application/schema+json). It answers 404 when the Schema does not exist or you may not read it.
The document describes one Subject of that Schema in the JSON the Subject endpoints accept and return (see Subject format): schema, label, and statements keyed by property name. Top-level keys beyond those are allowed, so the id a read adds and the comment a write takes do not make a Subject invalid. Every Constraint is described whatever its severity, so failing the document does not mean the wiki would reject the Subject.
A Subject that validates against the document draws no Violations for its values, except for what the document cannot express:
- whether a relation target exists and which Schema it follows; a relation's
targetandidare described as any string minimumandmaximumondateanddateTimeproperties- a calendar-impossible date such as
2025-02-30, unless your validator assertsformat - for a Property Type an extension adds, whatever its own description of its values leaves out
- whitespace: the wiki trims each part of a value and drops empty parts before checking it
- letter case in a
monolingualTextlanguage tag, which the wiki ignores when it checksuniqueItems
POST /neowiki/v0/subject/validate checks a proposed Subject against the wiki itself.
Where the document is stricter than the write endpoints:
- a Statement for a property the Schema does not declare is rejected; the wiki stores it
- a
selectvalue must be an option id; the write endpoints also take an option label or an{ "id", "label" }object - a Statement given as
nullor withoutpropertyTypeis rejected; the wiki drops it - a value with more parts than its property allows is rejected; the wiki checks
multipleonly forselect,relationandmonolingualText