spring-projects / spring-projects/spring-hateoas
Allow for Hal Forms extensions following Chapter 7 of the spec
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 476
- PR merge metrics
- No merged PRs in 30d
Description
Hal-Forms describes extensibility of Hal Forms.
https://github.com/mamund/hal-forms/blob/master/index.asciidoc#7-extending-the-hal-forms-document
I would find it useful if it were possible to extend Hal Responses with custom attributes of https://github.com/mamund/hal-forms/blob/master/index.asciidoc#property-element. While it is possible to customize single existing Hal Form Property Attributes using the InputPayloadMetadata.customize function, it seems not possible to add additional attributes.
That would give implementers at least some of the flexibility Mike Amundsen has intended with chapter 7, e.g. to demonstrate a spring hateoas based working implementation of such an extension that could later become part of the spec.
Simple idea: a new annotation that allows additional key-value pairs on a field, sth like:
@HalFormPropertyExtensions({
@HalFormPropertyAttribute(name = "myProperty", value = "myValue"),
@HalFormPropertyAttribute(name = "myProperty", value = "myValue")
})
private String schluessel;
Could probably also be achieved with @JsonAppend, now that I think about it. I'll let you know, and be it simply as a discussed extensibility of Spring Hateoas ;-)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the InputPayloadMetadata.customize extension point and the Hal Forms property-element rules in the linked Chapter 7 specification. Compare the proposed annotation approach with JsonAppend and define how custom key-value attributes should be represented; done means an implementer can add extension attributes to Hal Forms properties.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100