【问题标题】:StrongLoop API Explorer returning an errorStrongLoop API Explorer 返回错误
【发布时间】:2014-09-26 11:28:56
【问题描述】:

我刚刚尝试使用 http://docs.strongloop.com/display/LB/Use+API+Explorer 中解释的 StrongLoop API Explorer;从https://github.com/strongloop/loopback-explorer下载示例代码开始,我已按照文档中指示的所有步骤进行操作。

当我点击“试试看”时,我不断收到 JS 错误(来自 firebug)

TypeError: this.type.split is not a function
http://localhost:3000/explorer/lib/shred.bundle.js
Line 2034

以下是我不断收到的响应正文

{
    "error": {
"name": "ValidationError",
"status": 422,
"message": "The `Person` instance is not valid. Details: `FirstName` can't be blank; `LastName` can't be blank; `Age` can't be blank; `DOB` can't be blank.",
"statusCode": 422,
"details": {
  "context": "Person",
  "codes": {
    "FirstName": [
      "presence"
    ],
    "LastName": [
      "presence"
    ],
    "Age": [
      "presence"
    ],
    "DOB": [
      "presence"
    ]
  },
  "messages": {
    "FirstName": [
      "can't be blank"
    ],
    "LastName": [
      "can't be blank"
    ],
    "Age": [
      "can't be blank"
    ],
    "DOB": [
      "can't be blank"
    ]
  }
},
"stack": "ValidationError: The `Person` instance is not valid. Details: `FirstName` can't be blank; `LastName` can't be blank; `Age` can't be blank; `DOB` can't be blank.\n    at D:\\explorerAPI\\node_modules\\loopback-datasource-juggler\\lib\\dao.js:156:16\n    at ModelConstructor.<anonymous> (D:\\explorerAPI\\node_modules\\loopback-datasource-juggler\\lib\\validations.js:453:11)\n    at ModelConstructor.next (D:\\explorerAPI\\node_modules\\loopback-datasource-juggler\\lib\\hooks.js:66:12)\n    at ModelConstructor.<anonymous> (D:\\explorerAPI\\node_modules\\loopback-datasource-juggler\\lib\\validations.js:450:23)\n    at ModelConstructor.trigger (D:\\explorerAPI\\node_modules\\loopback-datasource-juggler\\lib\\hooks.js:56:12)\n    at ModelConstructor.Validatable.isValid (D:\\explorerAPI\\node_modules\\loopback-datasource-juggler\\lib\\validations.js:430:8)\n    at Function.DataAccessObject.create (D:\\explorerAPI\\node_modules\\loopback-datasource-juggler\\lib\\dao.js:152:7)\n    at SharedMethod.invoke (D:\\explorerAPI\\node_modules\\loopback\\node_modules\\strong-remoting\\lib\\shared-method.js:207:17)\n    at HttpContext.invoke (D:\\explorerAPI\\node_modules\\loopback\\node_modules\\strong-remoting\\lib\\http-context.js:243:12)\n    at D:\\explorerAPI\\node_modules\\loopback\\node_modules\\strong-remoting\\lib\\remote-objects.js:475:9"

} }

对于解决此问题的任何帮助将不胜感激。

提前谢谢你

【问题讨论】:

    标签: javascript api loopbackjs strongloop


    【解决方案1】:

    这是由https://github.com/wordnik/swagger-js/issues/107 引起的回归。我们正在研究解决方法:https://github.com/strongloop/loopback-explorer/pull/29。应该很快就合并了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-04
      • 2016-10-20
      • 2015-08-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多