使用openapi生成前端请求文件报错 ‘Token “Integer“ does not exist.‘

json 复制代码
{
  stack: 'JSONParserError: Token "Integer" does not exist.\n' +
    '    at Pointer.resolve (F:\\IdeaProjects\\yu-oj\\oj-frontend\\node_modules\\@apidevtools\\json-schema-ref-parser\\dist\\lib\\pointer.js:103:23)\n' +
  name: 'MissingPointerError',
  message: 'Token "Integer" does not exist.',
  source: 'http://localhost:8101/api/v2/api-docs',
  path: null,
  toJSON: [Function: toJSON],
  footprint: 'null+http://localhost:8101/api/v2/api-docs+EUNMATCHEDRESOLVER+Token "Integer" does not exist.',
  toString: [Function: toString]
}

这时候你可能会觉得是后端接口的controller方法的参数写的有问题。

最后我找到了问题,就是有一个controller返回的是RMap(Redis里的一个数据结构)。只需要把这个map转为其他结构就行

其实,之前我直接用map也可以跑(我还没找到具体原因),总之问题解决了。

如果你遇到同样的问题,就排查接口,挨个排查,总能找到答案的。

相关推荐
小赵同学WoW13 小时前
1-2 TypeScript 中的 `any` 与 `unknown`
前端
刘立军13 小时前
RESTful 与契约优先:规范接口定义,统一接口设计范式
后端·架构·ai编程
six_13 小时前
C# 上位机(持续更新中)
前端·面试·c#
风雨_13 小时前
Git Worktree sourcetree完整使用指南
前端
半个落月13 小时前
React 组件通信进阶:useContext 与自定义 Hook 实战详解
前端·react.js
用户9210802628613 小时前
ChatComposer 输入区改造:基于技能市场实现 Agent 输入框
前端
用户459892045651613 小时前
一套 KMP 多仓库版本治理工作流:用 Version Catalog + CI 把发版流水线自动化
前端·kotlin
小赵同学WoW13 小时前
1-4 TypeScript 中的 `number`、`bigint` 与 `string`
前端
JavaGuide13 小时前
GitHub 4.5 万+ Star!GitNexus 把代码仓库变成了 Claude Code / Codex 能查询的知识图谱
后端·ai编程
小赵同学WoW13 小时前
1-3 `boolean` 与字面量类型
前端