File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,11 +7,24 @@ type Parameters = NonNullable<Components["parameters"]>;
77type ParameterObject = Parameters [ keyof Parameters ] ;
88
99/**
10- * Fetch OpenAPI spec from @neaps/api at build time
10+ * Path prefix where the neaps API is mounted in the Open Waters API.
11+ * Mirrors what neaps does internally with `servers: [{ url: prefix }]`.
12+ */
13+ const NEAPS_PREFIX = "/tides" ;
14+
15+ /**
16+ * Fetch OpenAPI spec from @neaps/api at build time, prefixing paths with the
17+ * mount point used by the Open Waters API.
1118 */
1219export async function getOpenAPISpec ( ) : Promise < OpenAPISpec > {
1320 const { openapi } = await import ( "@neaps/api" ) ;
14- return openapi ;
21+ const paths = Object . fromEntries (
22+ Object . entries ( openapi . paths ) . map ( ( [ path , pathItem ] ) => [
23+ path === "/" ? NEAPS_PREFIX : `${ NEAPS_PREFIX } ${ path } ` ,
24+ pathItem ,
25+ ] ) ,
26+ ) ;
27+ return { ...openapi , paths } as OpenAPISpec ;
1528}
1629
1730/**
You can’t perform that action at this time.
0 commit comments