Skip to content

Commit

Permalink
add documentation, remove unused export
Browse files Browse the repository at this point in the history
  • Loading branch information
camflan committed Dec 9, 2024
1 parent fec711e commit 7b3be06
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@camflan/valibot-openapi-generator",
"version": "2024.12.12",
"version": "2024.12.13",
"exports": {
".": "./mod.ts"
}
Expand Down
1 change: 0 additions & 1 deletion mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export { describeRoute } from "./src/route.ts";
export { getOpenAPISpecs } from "./src/openapi.ts";
export { resolver as schemaResolver } from "./src/valibot.ts";
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "valibot-openapi-generator",
"version": "2024.12.12",
"version": "2024.12.13",
"description": "",
"type": "module",
"sideEffects": false,
Expand Down
5 changes: 5 additions & 0 deletions src/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[],
{
Expand Down
6 changes: 6 additions & 0 deletions src/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7b3be06

Please sign in to comment.