Skip to content
Meeko
Type to search the guides and the API reference. Open it from any page with / or Ctrl K; move with the arrow keys and open a result with Enter.
Get started

Contents

On this page

Not translated yet

This page has not been translated into English yet, so it is shown in Spanish.

OpenApiOptions

interfaz

Opciones de generateOpenApi.

ts
import type { OpenApiOptions } from "@meekojs/meeko/server";

Source code src/server/api/openapi.ts:27

Declaración #

ts
interface OpenApiOptions {
	manifest: ServerManifest
	info: { title: string; version: string }
	publicSchemas: Readonly<Record<string, Schema>>
	toJsonSchema(schema: Schema): unknown
	load: ServerModuleLoader
	cookieName?: string
}

Example #

ts
import { pathToFileURL } from "node:url";
import { toJsonSchema } from "@valibot/to-json-schema";
import type { OpenApiOptions, Schema } from "@meekojs/meeko/server";
import * as schemas from "./shared/schemas/user.js";

const options: OpenApiOptions = {
  manifest,
  info: { title: "Mi API", version: "1.0.0" },
  publicSchemas: schemas,
  toJsonSchema: (schema: Schema) => toJsonSchema(schema as never),
  load: (file) => import(pathToFileURL(file).href),
};

Miembros #

manifest #

propiedad

manifest: ServerManifest

Manifiesto con los endpoints.

info #

propiedad

info: { title: string; version: string }

info.title e info.version del documento.

publicSchemas #

propiedad

publicSchemas: Readonly<Record<string, Schema>>

Registro de schemas públicos por nombre; sólo los que exporta shared/schemas.

toJsonSchema #

método

toJsonSchema(schema: Schema): unknown

Convierte un schema en JSON Schema; para Valibot, el conversor de @valibot/to-json-schema.

load #

propiedad

Resuelve cada clave del manifiesto a su módulo de handler.

cookieName #

propiedad opcional

cookieName?: string

Nombre de la cookie de sesión del esquema de seguridad; por defecto, __Host-meeko.sid.

See also #

Was this page helpful?

Add a comment

It is sent when you choose “Yes” or “No”. Only the page, your answer and the comment are stored: no cookies and no personal data.

0 of 2000 characters

Edit on GitHub: packages/meeko/src/server/api/openapi.ts