pont icon indicating copy to clipboard operation
pont copied to clipboard

配置origins,多个数据源是,mock数据生成失败

Open ZNN-She opened this issue 1 year ago • 1 comments

What happens(发生了什么)?

配置origins,多个数据源是,mock数据生成失败 只生成了下面这段代码

const defs = {};

const escapeDeadCycle = (fn, num = 30) => {
  let n = 0;

  return (...args) => {
    if (n > num) return {};
    n++;

    const res = fn(...args);

    return res;
  };
};

Object.keys(defs).forEach((key) => {
  defs[key] = escapeDeadCycle(defs[key]);
});

export default {};

Mini Showcase Repository(迷你展示库)

官网提供的pont-demo修改下pont-config就能复现

How To Reproduce(如何重现)

修改官方提供的pont-demo的pont-config配置文件如下

{
  "outDir": "./src/services",
  "templatePath": "./pontTemplate",
  "mocks": {
    "enable": true
  },
  "origins": [
    {
      "name": "testApi",
      "originType": "SwaggerV2",
      "originUrl": "https://petstore.swagger.io/v2/swagger.json",
      "outDir": "./src/services/test"
    }
  ]
}

Context(上下文)

  • pont Version: 1.6.3
  • Node Version: 16.20.1
  • Platform(操作系统平台): mac os

ZNN-She avatar Oct 07 '24 10:10 ZNN-She

转战pontx吧

jasonHzq avatar Oct 14 '24 11:10 jasonHzq