@furystack/rest-service
Version:
Repository implementation for FuryStack
16 lines • 933 B
TypeScript
import type { RestApiImplementation } from '../api-manager.js';
import { getSchemaFromApi } from '../get-schema-from-api.js';
import { type RequestAction } from '../request-action-implementation.js';
export type GetSchemaResult = ReturnType<typeof getSchemaFromApi>;
/**
* Creates a GET action that returns the schema of the provided API.
* The schema is returned in JSON format when the request's Accept header includes 'application/schema+json'.
* If the Accept header does not match, a 406 Not Acceptable error is thrown.
*
* @param api - The API implementation from which to extract the schema.
* @returns A RequestAction that handles the GET request for the schema.
*/
export declare const CreateGetSchemaAction: <T extends RestApiImplementation<any>>(api: T, name?: string, description?: string, version?: string) => RequestAction<{
result: GetSchemaResult;
}>;
//# sourceMappingURL=create-get-schema-action.d.ts.map