From 7b3be06f52336fb1aa3a26f6e80d8d038c49cc47 Mon Sep 17 00:00:00 2001 From: Camron Flanders Date: Mon, 9 Dec 2024 14:36:12 -0600 Subject: [PATCH] add documentation, remove unused export --- jsr.json | 2 +- mod.ts | 1 - package.json | 2 +- src/openapi.ts | 5 +++++ src/route.ts | 6 ++++++ 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/jsr.json b/jsr.json index 2904760..4e139b6 100644 --- a/jsr.json +++ b/jsr.json @@ -1,6 +1,6 @@ { "name": "@camflan/valibot-openapi-generator", - "version": "2024.12.12", + "version": "2024.12.13", "exports": { ".": "./mod.ts" } diff --git a/mod.ts b/mod.ts index c3bc373..1635bd6 100644 --- a/mod.ts +++ b/mod.ts @@ -1,3 +1,2 @@ export { describeRoute } from "./src/route.ts"; export { getOpenAPISpecs } from "./src/openapi.ts"; -export { resolver as schemaResolver } from "./src/valibot.ts"; diff --git a/package.json b/package.json index b84fdc1..58d770f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "valibot-openapi-generator", - "version": "2024.12.12", + "version": "2024.12.13", "description": "", "type": "module", "sideEffects": false, diff --git a/src/openapi.ts b/src/openapi.ts index a044293..0fe5bcd 100644 --- a/src/openapi.ts +++ b/src/openapi.ts @@ -13,6 +13,11 @@ import type { const DEFAULT_TITLE = "Valibot schema documentation"; const DEFAULT_DESCRIPTION = "Development documentation"; +/** getOpenAPISpecs + * Combines DescribedRoutes into a single OpenAPI document. + * + * @returns OpenAPIV3.Document + */ export async function getOpenAPISpecs( routes: DescribedRoute[], { diff --git a/src/route.ts b/src/route.ts index 8840694..e81fe97 100644 --- a/src/route.ts +++ b/src/route.ts @@ -24,6 +24,12 @@ type HandleSchemaOptions = { config: OpenAPIRouteHandlerConfig; }; +/** describeRoute + * Creates a route description that will be used by getOpenAPISpecs to combine + * into a single OpenAPI spec document. + * + * @returns DescribedRoute - Route description for getOpenAPISpecs + */ export function describeRoute( path: string, { method, ...specs }: DescribeRouteOptions,