Brain Docs

Reference

Python SDKInstallationHTTP clientWire clientSync vs async
get_schemavalidate_schemaupload_schemareplace_schemadrop_schemalist_schemaslist_extractors
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
Python SDKSchemavalidate_schema

validate_schema

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
validate_schema(schema_document: str) -> SchemaValidate
Handshake credentialstable
validate_schema(request: SchemaValidateRequest) -> SchemaValidateResponse

Parameters

ParameterTypeRequired
schema_documentstringrequired

The document to check.

Returns

FieldTypePresence
namespacestringalways

The namespace it would land in.

would_be_versionintegeralways

The version it would take if uploaded.

validation_errorsSchemaError[]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
upload_schema

Was this page helpful?

get_schema

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

upload_schema

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