1

我是 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]
     }
     ]
   }

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

4

1 回答 1

0

不,您不能在上下文中指定它。但是,您可以做的是将操作绑定到 Hydra 中的属性ApiDocumentation规范中的示例 10)并通过 HTTP Link 标头引用它

于 2015-06-21T15:46:21.780 回答