Skip to content

Support HAL-FORMS target template element property #1427

Closed
@toedter

Description

@toedter

In the HAL-FORMS Spec (see https://rwcbook.github.io/hal-forms/#_code_target_code), an optional target property could be defined for each template element. It would be great if Spring HATEOAS would support this when creating a HAL-FORMS affordance.

An example would look like:

{
  "_links": {
    "self": {
      "href": "http://movies.com/api/movies"
    }
  },
  "_templates": {
    "default": {
      "title": "Create Rating",
      "method": "post",
      "contentType": "",
      "properties": [
        {
          "name": "movie-id",
          "prompt": "Movie ID",
          "required": true
        },
        {
          "name": "rating",
          "prompt": "Rating",
          "required": true
        }
      ],
      "target": "http://movies.com/api/ratings"
    }
  }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions