langgenius/dify · error · Error

Duplicate console API schema after FastOpenAPI merge: ${sche

Error message

Duplicate console API schema after FastOpenAPI merge: ${schemaName}

What it means

Error "Duplicate console API schema after FastOpenAPI merge: ${schemaName}" thrown in langgenius/dify.

Source

Thrown at packages/contracts/openapi-ts.api.config.ts:291

  const fastOpenApiDocument = readApiSwagger(fastOpenApiConsoleSpecFilename)
  const targetPaths = (document.paths ??= {})

  for (const [routePath, pathItem] of Object.entries(fastOpenApiDocument.paths ?? {})) {
    const contractPath = routePath.startsWith(fastOpenApiConsolePathPrefix)
      ? routePath.slice(fastOpenApiConsolePathPrefix.length) || '/'
      : routePath

    if (targetPaths[contractPath])
      throw new Error(`Duplicate console API path after FastOpenAPI merge: ${contractPath}`)

    targetPaths[contractPath] = pathItem
  }

  const targetSchemas = getDocumentSchemas(document)
  const sourceSchemas = getDocumentSchemas(fastOpenApiDocument)
  for (const [schemaName, schema] of Object.entries(sourceSchemas)) {
    if (targetSchemas[schemaName])
      throw new Error(`Duplicate console API schema after FastOpenAPI merge: ${schemaName}`)

    targetSchemas[schemaName] = schema
  }

  return document
}

const topLevelPathSegment = (routePath: string) => {
  return routePath.split('/').filter(Boolean)[0] ?? 'root'
}

const selectReferencedSchemas = (
  schemas: Record<string, SwaggerSchema>,
  paths: Record<string, Record<string, unknown>>,
) => {
  const selectedSchemas: Record<string, SwaggerSchema> = {}
  const pendingRefs = new Set<string>()
  collectSchemaRefs(paths, pendingRefs)

View on GitHub (pinned to ef8544b173)

When it happens

Trigger: Thrown at packages/contracts/openapi-ts.api.config.ts:291 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of langgenius/dify@ef8544b173 (2026-08-12). Data as JSON: /api/errors/a6039632f173b3ba. Report an issue: GitHub.