Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ZNN-She opened this issue Oct 7, 2024 · 1 comment
Open

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

ZNN-She opened this issue Oct 7, 2024 · 1 comment

Comments

@ZNN-She
Copy link

ZNN-She commented Oct 7, 2024

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
@jasonHzq
Copy link
Collaborator

转战pontx吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants