Beignet API reference
    Preparing search index...

    Class ContractBuilder<TMethod, TPathParams, TQuery, TBody, THeaders, TResponses, TMeta, TPath>

    Fluent builder for one HTTP contract.

    A contract describes the transport boundary for one endpoint: method, path, request schemas, response schemas, metadata, and route-owned catalog errors. Builder methods are immutable; each call returns a new builder with narrower types.

    Type Parameters

    Index

    Constructors

    Properties

    kind: "http"
    localName: string
    method: TMethod
    name: string
    namespace?: string

    Accessors

    • get metadata(): TMeta

      Metadata consumed by hooks, OpenAPI generation, and app conventions.

      Returns TMeta

    • get path(): TPath

      URL path template alias.

      Returns TPath

    • get pathTemplate(): TPath

      URL path template for this contract.

      Returns TPath

    • get responseSchemas(): TResponses

      Response schemas keyed by HTTP status code.

      Returns TResponses

    • get schema(): {
          body: TBody;
          headers: THeaders;
          pathParams: TPathParams;
          query: TQuery;
          responses: TResponses;
      }

      Request and response schemas attached to this contract.

      Server adapters use these for validation. Client and frontend integrations use them for local validation and type inference.

      Returns {
          body: TBody;
          headers: THeaders;
          pathParams: TPathParams;
          query: TQuery;
          responses: TResponses;
      }

    Methods