【问题标题】:How to specify supported http operation for a resource in json-ld?如何为 json-ld 中的资源指定支持的 http 操作?
【发布时间】:2015-06-17 04:13:12
【问题描述】:

我是 JSON-LD 的新手,我想知道是否有任何方法可以在不使用 Hydra 的 supportedOperationsupportedProperty 的情况下指定 JSON-LD 中支持的资源操作>。 有什么方法可以指定上下文,例如:

    {
    "@context" : {
    "@vocab" : "http://www.schema.org/",
    "data" : "object",
    "id" :"Number",
    "name" : "alternateName",
    "full_name" : "name",
    "links" : {
        "@id" : "URL",
        "@type" : "collection"
    },
    "href" : "URL",
    "rel" : "relatedTo",
    "operation" : [
     {
      "href" : "http://example.com/resources/1/anotherresources/2",
      "method" : "POST",
      "expects" :[parameter list],
      "required" : [list of mandatory arguments],
      "fixed value" : [list of argument with fixed value for a resource]
     }
     ]
   }

任何指导都会有很大帮助..

【问题讨论】:

    标签: rest json-ld http-method hydra-core


    【解决方案1】:

    不,您不能在上下文中指定它。但是,您可以将操作绑定到 Hydra ApiDocumentation (example 10 in the spec) 和 reference it via an HTTP Link header 中的属性。

    【讨论】:

      猜你喜欢
      • 2018-05-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-30
      • 2017-04-28
      • 1970-01-01
      相关资源
      最近更新 更多