Check a template document
Check a template document against the schema and the rules the publish path applies, without publishing anything. Nothing is stored and no ref is claimed, so this is safe to call on a draft and safe to call repeatedly.
The body is the document itself, as JSON or YAML — not a JSON wrapper around it. Send Content-Type: application/yaml or application/json; either is read.
A document that is wrong is reported with every problem one pass can reach rather than the first, so a file with four mistakes takes one call — see problems in the response for the one case where fixing a problem reveals another. On success the two digests come back: doc_digest identifies the document and changes with anything that changes what it MEANS, and build_digest covers only what decides the image — so a new label or a version bump leaves it alone. build_digest is present only for a document with no spec.from, and such a document builds nothing: spec.build and spec.env need a parent. A document that names a parent in spec.from — which is every document that builds — has no build_digest, because that cannot be computed without the parent image’s, so comparing it cannot tell you whether an edit to such a document means a rebuild.
Requires the member role or higher.
Request
- Base URL: https://app.mandala.computer/api/v1
- URL: https://app.mandala.computer/api/v1/templates/validate
- Auth: HTTP bearer
Response
valid is what you branch on, and both branches are 200: an invalid document is an answer to the question, not a failed request. false brings problems and nothing else; true brings the ref, the digests, the catalogue row and the canonical bytes.
Three of the fields below — template, canonical and build_digest_needs — were on this wire and in no reader’s copy of it until OPL-4179, which wrote them out here in prose. OPL-4190 gave the response a schema, so the table is now held against the code that produces it rather than kept in step by hand. In the same change template stopped carrying the on-host image family, which is ours rather than yours and was already projected away on every other route that answers a catalogue row.
Changes
No recorded changes to this operation across all 1 revision of this API.