mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 03:55:38 -04:00
feat(docs): use parameterized OpenAPI server URL
Replace the static `https://sofa.example.com/api/v1` server entry with a variable-based URL (`{protocol}://{host}:{port}/api/v1`) so the spec works against any instance out of the box. Also move the output path from `docs/openapi.json` to `docs/public/openapi.json` so the file is served as a static asset by the docs site.
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import { OpenAPIGenerator } from "@orpc/openapi";
|
||||
import {
|
||||
OpenAPIGenerator,
|
||||
type OpenAPIGeneratorGenerateOptions,
|
||||
} from "@orpc/openapi";
|
||||
import { ZodToJsonSchemaConverter } from "@orpc/zod/zod4";
|
||||
import {
|
||||
BackupSchema,
|
||||
@@ -214,7 +217,7 @@ export function normalizeOpenApiSpec<T extends OpenApiSpec>(spec: T): T {
|
||||
export async function generateOpenApiSpec(options: {
|
||||
title: string;
|
||||
version: string;
|
||||
servers: Array<{ url: string }>;
|
||||
servers: OpenAPIGeneratorGenerateOptions["servers"];
|
||||
sessionCookieName: string;
|
||||
tags?: Array<{ name: string; description?: string }>;
|
||||
}): Promise<OpenApiSpec> {
|
||||
|
||||
Reference in New Issue
Block a user