Skip to content

createEndpoint

createEndpoint<Req, Res>(config): ApiEndpoint<Req, Res>

Defined in: wp-typia-api-client/src/client.ts:432

Freeze an endpoint configuration as a typed public contract.

Req

Res

ApiEndpoint<Req, Res>

Endpoint metadata and validators to expose.

ApiEndpoint<Req, Res>

The same config, preserved as an ApiEndpoint.

const endpoint = createEndpoint({
method: "GET",
path: "/wp-typia/v1/items",
validateRequest,
validateResponse,
});