我刚刚尝试使用StrongLoop API Explorer,如http://docs.strongloop.com/display/LB/Use+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"
} }
任何帮助解决这个问题都将受到高度赞赏。
提前谢谢
答案 0 :(得分:0)
这是由https://github.com/wordnik/swagger-js/issues/107引起的回归。我们正在寻找解决方法:https://github.com/strongloop/loopback-explorer/pull/29。它应该很快合并。