WSO2 REST add.jar获取空指针异常



我正在尝试使用REST add.jag添加一个API。在1.9.1和1.10.0上都尝试过。在仪表板UI中,它被添加为ok,但带有以下消息

Status code: 200
{
    "message": " null",
    "error": true
}

日志文件显示

[2016-01-10 16:21:22,956] ERROR {JAGGERY.site.blocks.item-add.ajax.add:jag} -  java.lang.NullPointerException: null {JAGGERY.site.blocks.item-add.ajax.add:jag}

我在CURL和Python中都运行了这个,得到了相同的错误。这是我发送给REST的正文:

body = {
  "action" : "addAPI",
  "name" : "employee",
  "context" : "/employee",
  "version=" : "1.0.0",
  "visibility" : "public",
  "description" : "list employees",
  "endpointType" : "nonsecured",
  "http_checked" : "http",
  "https_checked" : "https",
  "tier" : "Unlimited",
  "tiersCollection" : "Unlimited,Silver",
  "environments" : "Production",
  "resourceCount" : "0",
  "resourceMethod-0" : "GET",
  "resourceMethodAuthType-0" : "Application",
  "resourceMethodThrottlingTier-0" : "Unlimited",
  "endpointConfig" : '{"production_endpoints":{"url":"http://localhost:8080/sample2/api/company/employees","config":null},"endpoint_type":"http"}'
  "endpointType" : "nonsecured" 
}

好的,开始工作了。以下是一组更新的车身参数似乎失踪的是uriTemplate-0。

body
{
  "action" : "addAPI",
  "name" : "employee",
  "context" : "/employee",
  "version" : "1.0.0",
  "visibility" : "public",
  "thumburl" : "",
  "description" : "list employees",
  "tags" : "company,employees",
  "endpointType" : "nonsecured",
  "tiersCollection" : "Gold,Silver",
  "http_checked" : "http",
  "https_checked" : "https",
  "bizOwner" : "xx",
  "bizOwnerMail" : "xx@ee.com",
  "techOwner" : "xx",
  "techOwnerMail" : "xx@ee.com",
  'resourceCount': '0',
  'resourceMethod-0': 'GET',
  "resourceMethodAuthType-0" : "Application",
  'resourceMethodThrottlingTier-0': 'Unlimited',
  "uriTemplate-0" : "/*",
  'default_version_checked': 'default_version',
  'endpoint_config': '{"production_endpoints":{"url":"http://ws.cdyne.com/phoneverify/phoneverify.asmx","config":null},"endpoint_type":"http"}'
}

最新更新