api-mocker icon indicating copy to clipboard operation
api-mocker copied to clipboard

导入 RapJSON 提示格式错误

Open HamGuy opened this issue 5 years ago • 1 comments

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)
      })

HamGuy avatar Apr 29 '19 02:04 HamGuy

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

pzljp avatar Apr 29 '19 10:04 pzljp