【问题标题】:org.codehaus.jackson.JsonParseException: Unexpected character ('d' (code 100)): was expecting comma to separate OBJECT entries\norg.codehaus.jackson.JsonParseException: 意外字符 ('d' (code 100)): 期望用逗号分隔 OBJECT 条目\n
【发布时间】:2021-06-16 17:00:51
【问题描述】:

我在做什么: REST API 调用以创建包含融合表的页面。

  • 当我使用 POSTMAN 并以 JSON 格式执行给定代码时,它会创建一个带有表格的页面。 { "title": "Title", "type": "page", "space":{ "key": "spacekeyhere" }, "status": "current", "ancestors": [{ "id": "parentid" }], "body": { "storage":{ "value": "<table data-layout=\"default\"><colgroup><col style=\"width: 226.67px;\" /><col style=\"width: 226.67px;\" /><col style=\"width: 226.67px;\" /></colgroup><tbody><tr><th><p><strong>Col1</strong></p></th><th><p><strong>Col2</strong></p></th><th><p /></th></tr><tr><td><p>AAA</p></td><td><p>A</p></td><td><p /></td></tr><tr><td><p>testing 2</p></td><td><p>B</p></td><td><p /></td></tr></tbody></table>", "representation": "storage" },}}

但是当我在 NODE.js (visual studio) (content-type 仍然是 json) 中使用相同的代码时,它会抛出一个错误:响应:500 内部服务器错误 {"statusCode":500,"message":"org.codehaus.jackson.JsonParseException: Unexpected character ('d' (code 100)): 在 [Source: com.atlassian.plugins .rest.common.limitrequest.jersey.LimitingRequestFilter$1@2eb4e939;行:11,列:39]"}

去掉代码中的 CSS 之后。

改为 , 有效 但是为什么它会导致这种格式出现问题,因为它不应该有任何区别呢?

【问题讨论】:

    标签: json api rest


    【解决方案1】:

    我遇到了同样的问题,我在几分钟前找到了解决方法。 在您的字符串中,您应该将“替换为” 所以基本上在你的身体部分:

    <table data-layout=\"default\"><colgroup><col style=\"width: 226.67px;\" /><col style=\"width: 226.67px;\" /><col style=\"width: 226.67px;\" /></colgroup>
    

    成为:

    <table data-layout='default'><colgroup><col style='width: 226.67px;' /><col style='width: 226.67px;' /><col style='width: 226.67px;' /></colgroup>
    

    而且我还认为,您可以将其称为图表或您可以插入的链接的每种宏都需要它。

    希望它可以帮助你或其他人。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-08-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多