spring-projects / spring-projects/spring-hateoas

Add support for @ModelAttribute

Open
#1,240 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: core stack: webmvc
Dominant language
Java
Stars
1.1k
Forks
476
PR merge metrics
No merged PRs in 30d

Description

Controller method parameters annotated with MVC's @ModelAttribute currently do not get represented in HAL. Adding support for that Annotation (provided explictly or implicitly) would be appreciated. @gregturn suggested that QueryParameter, currently responsible for @RequestParam, could be modified to cover that Attribute as well.

Note that RFC6570 - aside from its form-style query expansion - also defines a composite value using an "explode" modifier ("*"). Support for @ModelAttribute could conveivably take either shape, or even offer that choice to the developer in some way.

style example
simple form style {?field1,field2,field3,page,size,sort}
with composite value {?myClass*,page,size,sort}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading QueryParameter, which currently handles @RequestParam, and compare its behavior with explicit and implicit @ModelAttribute parameters. Review the RFC6570 form-style and explode alternatives; done means an agreed representation for model attributes is supported in HAL.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.