Type-check a handler body without saving or running it
POST
/api/v1/admin/handlers/validate
const url = 'http://localhost:11044/api/v1/admin/handlers/validate';const options = { method: 'POST', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>', 'Content-Type': 'application/json'}, body: '{"source":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:11044/api/v1/admin/handlers/validate \ --header 'Content-Type: application/json' \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \ --data '{ "source": "example" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”The TypeScript handler body in source, type-checked by the same tsc gate a save applies. Nothing is saved or run
Media typeapplication/json
A handler body to type-check without saving or running it.
object
source
required
The TypeScript handler body to type-check.
string
Example generated
{ "source": "example"}Responses
Section titled “Responses”The tsc verdict, with its errors in source coordinates
Media typeapplication/json
The tsc verdict on a handler body, without saving or running it.
object
durationMs
required
Server-side time the type-check took, in milliseconds.
integer format: int64
ok
required
Always true; valid carries the verdict.
boolean
valid
required
Whether the body passes the tsc gate save enforces.
boolean
violations
required
The compiler’s errors, in the SOURCE’s own line coordinates. Empty when valid.
Array<string>
Example generated
{ "durationMs": 1, "ok": true, "valid": true, "violations": [ "example" ]}No authenticated principal
Media typeapplication/json
A refusal carrying only a human-readable reason.
object
error
required
What went wrong, in the terms the caller can act on.
string
Example generated
{ "error": "example"}
