diff --git a/apps/web/src/app/api/v1/openapi.json/route.ts b/apps/web/src/app/api/v1/openapi.json/route.ts index d4a58f8..07b811e 100644 --- a/apps/web/src/app/api/v1/openapi.json/route.ts +++ b/apps/web/src/app/api/v1/openapi.json/route.ts @@ -1,4 +1,4 @@ -import { buildOpenApiDocument } from "@pointup/core/contracts"; +import { buildOpenApiDocument } from "@pointup/core/openapi"; import { NextResponse } from "next/server"; /** diff --git a/packages/core/package.json b/packages/core/package.json index 7c05c95..8a4add2 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -7,6 +7,7 @@ "exports": { ".": "./src/index.ts", "./contracts": "./src/contracts/index.ts", + "./openapi": "./src/contracts/openapi.ts", "./providers": "./src/domain/loyalty/provider.ts", "./db/schema": "./src/infrastructure/db/schema.ts" }, diff --git a/packages/core/src/contracts/index.ts b/packages/core/src/contracts/index.ts index bf39b6c..8c072b7 100644 --- a/packages/core/src/contracts/index.ts +++ b/packages/core/src/contracts/index.ts @@ -795,5 +795,8 @@ export function toIngestDealPageResultDto( }; } -// OpenAPI 3.1 document generated from the schemas above. -export * from "./openapi"; +// The OpenAPI generator (`buildOpenApiDocument`) lives in ./openapi and is +// exposed via the "@pointup/core/openapi" subpath. It is intentionally NOT +// re-exported here: it imports from this module, so re-exporting would create +// an import cycle (index -> openapi -> index) that fails at load with a TDZ +// "Cannot access '...' before initialization" error.