Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand HAL-FORMS to handle immutable types properly regarding "readOnly" status #1282

Open
gregturn opened this issue Apr 29, 2020 · 1 comment · May be fixed by #2129
Open

Expand HAL-FORMS to handle immutable types properly regarding "readOnly" status #1282

gregturn opened this issue Apr 29, 2020 · 1 comment · May be fixed by #2129
Labels
in: mediatypes Media type related functionality

Comments

@gregturn
Copy link
Contributor

It's possible to create an immutable type where you have no setters. Instead, everything is built upon either constructor calls or "@With" or whatever, and the existing code would PROBABLY misread the "readOnly" nature of those types.

We need to expand the existing set of unit tests to cover such scenarios, and then potentially entertain a "hint" annotation that could be applied to properties, constructors, and even getters/setters. That way, Spring HATEOAS can try to guess as best as it can, but in the corner cases where it can't figure it out, grant users ability to mark up their code to help HAL-FORMS render things as desired.

Related issue: #1274.

@gregturn gregturn added the in: mediatypes Media type related functionality label Apr 29, 2020
@gregturn gregturn added this to the 1.2.0-M1 milestone Apr 29, 2020
@odrotbohm odrotbohm modified the milestones: 1.2 M1, 1.2 RC1 Aug 11, 2020
@gregturn gregturn modified the milestones: 1.2 RC1, 1.2 GA Sep 15, 2020
@odrotbohm odrotbohm modified the milestones: 1.2 GA, 1.3 M1 Oct 27, 2020
@odrotbohm odrotbohm modified the milestones: 1.3 M1, 1.3 M2 Jan 13, 2021
@odrotbohm odrotbohm modified the milestones: 1.3 M2, 1.3 RC1 Feb 16, 2021
@odrotbohm odrotbohm modified the milestones: 1.3 M3, 1.4 M1 Mar 15, 2021
@odrotbohm odrotbohm modified the milestones: 1.4 M1, 1.4 M2 Jul 14, 2021
@odrotbohm odrotbohm modified the milestones: 1.4 M2, 1.4 M3 Aug 12, 2021
@odrotbohm odrotbohm modified the milestones: 1.4 M3, 1.4 candidates Sep 16, 2021
@reda-alaoui
Copy link
Contributor

Hello @gregturn ,

Can I contribute with a pull request?

I have some questions about the hint annotation:

  • would it be dedicated to the readonly aspect (e.g. @ReadOnly(true) ) or more generic (e.g. @Hint(readonly = true) ) ?
  • would it be specific to HAL-FORMS? If yes, should the name of the annotation be prefixed by HalForms for example?
  • are there any similar annotations I could take inspiration from?

@odrotbohm odrotbohm removed this from the 1.4 candidates milestone Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: mediatypes Media type related functionality
Projects
None yet
3 participants