spring-projects / spring-projects/spring-data-rest

Provide a link to list all the values of enum fields. [DATAREST-179]

Open
#564 0 comments 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Dec 31, 2020.

type: enhancement
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

Open the contributing guide

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.