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

导入 RapJSON 提示格式错误 #46

Open
HamGuy opened this issue Apr 29, 2019 · 1 comment
Open

导入 RapJSON 提示格式错误 #46

HamGuy opened this issue Apr 29, 2019 · 1 comment
Labels

Comments

@HamGuy
Copy link

HamGuy commented Apr 29, 2019

Rap 更新了,数据结构不匹配,导入 Rap JSON 出现格式错误。简单修改了下(FromRap.vue),可以导入API 描述,但是参数和响应都没有:

      moduleList = json.data.modules[0]
      const apis = []
      moduleList.interfaces.forEach(action => {
        window.console.log(action)
        const apiName = `${json.data.name}-${action.name}`
        const api = new ApiInit()
        api.name = apiName
        api.desc = action.description
        api.prodUrl = action.url
        api.group = this.group._id
        const requestType = Number(action.method)
        api.options.method = this.methods[requestType - 1]
        const requests = action.properties.filter(p => p.scope === 'request')
        const responses = action.properties.filter(p => p.scope === 'response')
        api.options.params = this.buildReqParams(api.options.params, requests, requestType)
        api.options.response = this.buildResponse(responses)
        apis.push(api)
      })
@pzljp
Copy link
Member

pzljp commented Apr 29, 2019

@HamGuy 方便提供一下你的json文件吗?这边复现处理一下。

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

No branches or pull requests

3 participants