UNPKG

@mintlify/validation

Version:

Validates mint.json files

51 lines (50 loc) 1.78 kB
import { z } from 'zod'; import { asyncApiSchema } from './reusable/asyncapi.js'; import { openApiSchema } from './reusable/openapi.js'; export const apiSchema = z .object({ openapi: openApiSchema.optional(), asyncapi: asyncApiSchema.optional(), playground: z .object({ display: z .enum(['interactive', 'simple', 'none']) .optional() .describe('The display mode of the API playground. Defaults to `interactive`.'), proxy: z .boolean() .optional() .describe('Whether to pass API requests through a proxy server. Defaults to `true`.'), }) .optional() .describe('Configurations for the API playground'), examples: z .object({ languages: z .array(z.string()) .optional() .describe('Example languages for the autogenerated API snippets'), }) .optional() .describe('Configurations for the autogenerated API examples'), mdx: z .object({ auth: z .object({ method: z .enum(['bearer', 'basic', 'key', 'cobo']) .optional() .describe('Authentication method for the API'), name: z.string().optional().describe('Authentication name for the API'), }) .optional() .describe('Authentication configuration for the API'), server: z .union([z.string().url(), z.array(z.string().url())]) .optional() .describe('Base URL(s) for the API'), }) .optional() .describe('Configurations for API pages generated from MDX files'), }) .describe('API reference configuration and playground settings');