Brain Docs

Reference

TypeScript SDKInstallationHTTP clientWire client
getSchemavalidateSchemauploadSchemareplaceSchemadropSchemalistSchemaslistExtractors
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
TypeScript SDKSchemavalidateSchema

validateSchema

Check a schema document without storing it — with line, column and span for each error.

PURPOSE

Check a document without storing it. Nothing is written either way.

POST/v1/schema/validateBearer API keystable
validateSchema(input: SchemaValidateInput): Promise<SchemaValidateResult>
Handshake credentialstable
validateSchema(request: SchemaValidateRequest): Promise<SchemaValidateResponse>

Parameters

ParameterTypeRequired
schemaDocumentstringrequired

The document to check.

Returns

FieldTypePresence
namespacestringalways

The namespace it would land in.

wouldBeVersionintegeralways

The version it would take if uploaded.

validationErrorsSchemaError[]always

Empty means valid. Each error carries code, message, line, column, length and severity — enough to underline the offending span in an editor.

Validation failures are not exceptions

This verb resolves with a populated validationErrors array rather than throwing. Code that only wraps the call in a try/catch treats an invalid schema as a successful one. Check the array.

See also
uploadSchema

Was this page helpful?

getSchema

Read the active schema document, or a specific version of it.

uploadSchema

Publish a new schema version, with a dry run and an explicit opt-in for breaking changes.

On this page

ParametersReturns
Suggest an editOpen in Playground