{"record":{"id":"a6039632f173b3ba","repo":"langgenius/dify","slug":"duplicate-console-api-schema-after-fastopenapi-mer","errorCode":null,"errorMessage":"Duplicate console API schema after FastOpenAPI merge: ${schemaName}","messagePattern":"Duplicate console API schema after FastOpenAPI merge: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/contracts/openapi-ts.api.config.ts","lineNumber":291,"sourceCode":"  const fastOpenApiDocument = readApiSwagger(fastOpenApiConsoleSpecFilename)\n  const targetPaths = (document.paths ??= {})\n\n  for (const [routePath, pathItem] of Object.entries(fastOpenApiDocument.paths ?? {})) {\n    const contractPath = routePath.startsWith(fastOpenApiConsolePathPrefix)\n      ? routePath.slice(fastOpenApiConsolePathPrefix.length) || '/'\n      : routePath\n\n    if (targetPaths[contractPath])\n      throw new Error(`Duplicate console API path after FastOpenAPI merge: ${contractPath}`)\n\n    targetPaths[contractPath] = pathItem\n  }\n\n  const targetSchemas = getDocumentSchemas(document)\n  const sourceSchemas = getDocumentSchemas(fastOpenApiDocument)\n  for (const [schemaName, schema] of Object.entries(sourceSchemas)) {\n    if (targetSchemas[schemaName])\n      throw new Error(`Duplicate console API schema after FastOpenAPI merge: ${schemaName}`)\n\n    targetSchemas[schemaName] = schema\n  }\n\n  return document\n}\n\nconst topLevelPathSegment = (routePath: string) => {\n  return routePath.split('/').filter(Boolean)[0] ?? 'root'\n}\n\nconst selectReferencedSchemas = (\n  schemas: Record<string, SwaggerSchema>,\n  paths: Record<string, Record<string, unknown>>,\n) => {\n  const selectedSchemas: Record<string, SwaggerSchema> = {}\n  const pendingRefs = new Set<string>()\n  collectSchemaRefs(paths, pendingRefs)","sourceCodeStart":273,"sourceCodeEnd":309,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/packages/contracts/openapi-ts.api.config.ts#L273-L309","documentation":"Error \"Duplicate console API schema after FastOpenAPI merge: ${schemaName}\" thrown in langgenius/dify.","triggerScenarios":"Thrown at packages/contracts/openapi-ts.api.config.ts:291 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}