spring-projects / spring-projects/spring-data-rest
Wrong href with ManyToOne and FetchType.LAZY [DATAREST-1303]
Abierto
@odrotbohm ya está trabajando en esto.
Desde el 31/12/2020.
type: bug
- Lenguaje dominante
- Java
- Estrellas
- 958
- Forks
- 568
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Evaluación
Este issue todavía no se ha evaluado.