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

Expose ManyToOne relations from composite key in _links? #2240

Open
mwyrembl opened this issue Mar 16, 2023 · 3 comments
Open

Expose ManyToOne relations from composite key in _links? #2240

mwyrembl opened this issue Mar 16, 2023 · 3 comments
Labels
status: feedback-provided Feedback has been provided

Comments

@mwyrembl
Copy link

I have an Embeddable composite key consisting of two ManyToOne relations.
Currently they are exposed as one self href item resource link.
Is it possible to additionally expose each ManyToOne relation as a separate item resource link in the _links section?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 16, 2023
@gregturn
Copy link
Contributor

Could you include a link to a reproducer, staged on github, ideally using https://start.spring.io, H2 (or Testcontainers for PostGreSQL, etc.), that demonstrates the feature you are looking?

@gregturn gregturn added status: waiting-for-feedback We need additional information before we can continue and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 20, 2023
@spring-projects-issues
Copy link

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Mar 27, 2023
@mwyrembl
Copy link
Author

@gregturn
Here is the reproducer: https://github.com/mwyrembl/spring-data-rest-2240
If you start the project and request the resource:
http://localhost:8080/cs/1_1
you get:

{
  "d": {},
  "_links": {
    "self": {
      "href": "http://localhost:8080/cs/1_1"
    },
    "c": {
      "href": "http://localhost:8080/cs/1_1"
    }
  }
}

my question is if it is also possible to include links to A and B from the CId class like this without adding many-to-one relations in C class directly:

{
  "d": {},
  "a": {},
  "b": {},
  "_links": {
    "self": {
      "href": "http://localhost:8080/cs/1_1"
    },
    "c": {
      "href": "http://localhost:8080/cs/1_1"
    }
  }
}

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue labels Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: feedback-provided Feedback has been provided
Projects
None yet
Development

No branches or pull requests

3 participants