cubicweb-jsonschema #17082970 introduce rel="search" links [in-progress]

We want to introduce rel="search" hyper-schema links to manipulate relations.

This can happen in at least two places:

  • on a collection (for instance, a relation):

    {
      "title": "topics",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        }
      },
      "links": [
        // ...
        {
          "rel": "search",
          "title": "search topics-subject",
          "href": "/book/123/topics/{?name}",
          "hrefSchema": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "title": "name"
              }
            }
          }
        }
      ]
    }
    

    rel="search" makes it possible to search within targets of a relation (here the topics relation with /book/123 resource as object.

  • at entity level :

    {
      "title": "Book",
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "author": {
          "type": "string",
          "links": [
            {
              "rel": "search",
              "href": "/author?searchBy={name}",
              "hrefSchema": {
                "type": "object",
                "properties": {
                  "name": "string"
                }
              }
            }
          ]
        }
      }
    }
    

    the "author" property is searchable through rel="search" link. This is useful for edition form of an inlined but not composite relation.

priorityimportant
typetask
done in0.5.0
closed by<not specified>