spring-projects / spring-projects/spring-data-rest
Wrong href with ManyToOne and FetchType.LAZY [DATAREST-1303]
Offen
@odrotbohm arbeitet bereits daran.
Seit 31.12.2020.
type: bug
- Vorherrschende Sprache
- Java
- Sterne
- 958
- Forks
- 568
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Thomas Schuh opened DATAREST-1303 and commented
We have one entity called SignalRequest with a property signal:
@ManyToOne(fetch = FetchType.LAZY)
private Signal signal;
When we do a GET:
http://localhost:8080/api/v1/signalRequests/1/signal
the wrong href is returned (singular instead of plural):
"_links": {
"self": {
"href": "http://localhost:8080/api/v1/signal/2"
},
"signal": {
"href": "http://localhost:8080/api/v1/signal/2"
},
"signalRequests": {
"href": "http://localhost:8080/api/v1/signal/2/signalRequests",
"templated": true
}
}
With Spring Boot 2.0.6 href was correctly returned. The only workaround we have at the moment is to remove lazy fetch type.
Affects: 3.1.2 (Lovelace SR2)
9 votes, 2 watchers
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.