{"record":{"id":"bf706f6c13e5d0d2","repo":"langgenius/dify","slug":"invalid-enterprise-openapi-document-enterpriseo","errorCode":null,"errorMessage":"Invalid enterprise OpenAPI document: ${enterpriseOpenApiPath}","messagePattern":"Invalid enterprise OpenAPI document: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/contracts/openapi-ts.enterprise.config.ts","lineNumber":270,"sourceCode":"      if (!isOpenApiSchema(propertySchema)) return\n\n      promoteInlineEnumSchema(\n        schemas,\n        schemaName,\n        properties,\n        propertyName,\n        propertySchema,\n        valuesToSchemaKey,\n      )\n    })\n  })\n}\n\nconst normalizeEnterpriseOpenApi = () => {\n  const openApi = loadOpenApiYaml(fs.readFileSync(enterpriseOpenApiPath, 'utf8'))\n\n  if (!openApi || typeof openApi !== 'object' || Array.isArray(openApi))\n    throw new Error(`Invalid enterprise OpenAPI document: ${enterpriseOpenApiPath}`)\n\n  const document = openApi as OpenApiDocument\n  const paths = document.paths ?? {}\n\n  document.paths = Object.fromEntries(\n    Object.entries(paths)\n      .filter(([routePath]) => isConsoleApiPath(routePath))\n      .map(([routePath, pathItem]) => {\n        if (!isObject(pathItem)) return [stripConsoleApiPrefix(routePath), pathItem]\n\n        return [stripConsoleApiPrefix(routePath), stripSchemaLessResponseOperations(pathItem)]\n      })\n      .filter(([, pathItem]) => !isObject(pathItem) || Object.keys(pathItem).length > 0),\n  )\n\n  promoteReusableEnumSchemasForHeyApi(document)\n\n  return document","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/packages/contracts/openapi-ts.enterprise.config.ts#L252-L288","documentation":"Error \"Invalid enterprise OpenAPI document: ${enterpriseOpenApiPath}\" thrown in langgenius/dify.","triggerScenarios":"Thrown at packages/contracts/openapi-ts.enterprise.config.ts:270 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"}