spring-projects / spring-projects/spring-data-rest
Provide a link to list all the values of enum fields. [DATAREST-179]
@odrotbohm is already working on this.
Since Dec 31, 2020.
- Dominant language
- Java
- Stars
- 958
- Forks
- 568
- PR merge metrics
- No merged PRs in 30d
Description
Petar Tahchiev opened DATAREST-179 and commented
Hi guys,
in my datamodel I have an Order, and that order has enum value paymentStatus, which can be PAYED, NOT_PAYED or FRAUD_DETECTED. So SDR correctly returns the json as:
"paymentStatus" : "NOT_PAYED",
However, if I want to update the order I have to specify a correct paymentStatus, which I may not know (the code that i'm building is generic for orders, products ... ). So it would be beneficial if every enum values are added as a link, like this:
"links" : [ {
"rel" : "paymentStatuses",
"href" : "http://localhost:8111/rest/order/563638457675072/paymentStatuses"
},
...
so then using the RESTShell, or a browser, or whatever I can follow the link and see what the paymentStatuses are, and change it accordingly.
Affects: 2.0 M1 (Codd)
Issue Links:
- DATAREST-230 Add the ability to expose an ALPS resource for service documentation
1 votes, 1 watchers
Contributor guide
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.
Assessment
This issue has not been assessed yet.