Theia API Documentation v1.76.0
    Preparing search index...
    RestBodySchema: IJSONSchema & { __body?: B }

    A JSON Schema carrying the TypeScript type of the request bodies it accepts.

    Routes of the external API declaring a RestBodySchema get their request body validated against the schema and the schema published in the OpenAPI document, while the carried type flows into the route's handler and custom validation. The declaration of a schema constant is the single place asserting that schema and type agree. The type is not verified against the schema:

    export const SCHEMA: RestBodySchema<MyRequest> = {
    type: 'object',
    required: ['text'],
    additionalProperties: false,
    properties: {
    text: { type: 'string', description: 'The text to process.' }
    }
    };

    Type Parameters

    • B

    Type Declaration

    • Optional Readonly__body?: B

      Purely type-level marker carrying B; never present at runtime.