【问题标题】:Nested Collection+JSON Hypermedia Type Example嵌套集合+JSON 超媒体类型示例
【发布时间】:2013-11-15 16:52:20
【问题描述】:

Collection+JSON 的示例不显示嵌套集合的示例。谁能指出一个使用嵌套集合的 Collection+JSON 示例或描述他们成功的经验。

例如,这是否适用于链接到两个子集合的顶级入口点:

{
  "collection": {
    "version": "1.0",
    "href": "http://example.org/friends/",

    "links": [
      {
        "rel": "inbox",
        "href": "http://example.org/inbox"
      },
      {
        "rel": "contacts",
        "href": "http://example.org/contacts"
      }
    ]
  }
}

【问题讨论】:

    标签: json hypermedia collection-json


    【解决方案1】:

    我开始使用 collection+json 才几个月,我还不是一个完整的专家。

    我认为您正在寻找内联集合:

    https://github.com/collection-json/extensions/blob/master/inline.md

    (它仍然不在官方规范中,但它已被提议作为扩展)

    这是所有事物collection+json的主要github页面

    https://github.com/collection-json

    更新:刚刚发现这个讨论 https://groups.google.com/forum/#!topic/collectionjson/fsVSVaHl79I 不鼓励使用内联集合来定义它们https://groups.google.com/forum/#!topic/collectionjson/fsVSVaHl79I 的其他方式。

    我认为最好的方法是尝试一种方法,看看它是否适合您的问题空间,作为一个相对较新的规范,很多事情仍然需要解决。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-25
      • 2014-04-10
      • 2015-12-07
      • 1970-01-01
      • 2022-01-24
      • 1970-01-01
      • 2016-08-03
      • 1970-01-01
      相关资源
      最近更新 更多