You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using spring-hateoas:1.2.1 with Spring Boot 2.4.0:
When a REST controller class annotated with @RequestMapping("${some-variable}/resources") returns a resource extending RepresentationModel, I get the following error :
{
"label": "uncatched exception",
"detailMessage": "Not enough variable values available to expand 'some-variable'",
"statusCode": 500
}
I pinned the issue to this suspect line in the core library :
From what I could read, ContextLoader.getCurrentWebApplicationContext() doesn't return the expected context when using Spring Boot, and it's actually returning null when I place a breakpoint there :
You can see (L.92) that the resolvePlaceholders method won't be called, explaining my error since the raw string is passed on.
Any idea on how we could fix this ? :)
The text was updated successfully, but these errors were encountered:
I only searched is the open issues for duplicate, my bad, and this has already been partially fixed: #220
PR #1375 (not yet merged) seems to fix this issue, though !
lyca
linked a pull request
Dec 10, 2020
that will
close
this issue
Using spring-hateoas:1.2.1 with Spring Boot 2.4.0:
When a REST controller class annotated with
@RequestMapping("${some-variable}/resources")
returns a resource extendingRepresentationModel
, I get the following error :I pinned the issue to this suspect line in the core library :
spring-hateoas/src/main/java/org/springframework/hateoas/server/core/PropertyResolvingMappingDiscoverer.java
Line 90 in 646e73c
From what I could read,
ContextLoader.getCurrentWebApplicationContext()
doesn't return the expected context when using Spring Boot, and it's actually returningnull
when I place a breakpoint there :You can see (L.92) that the
resolvePlaceholders
method won't be called, explaining my error since the raw string is passed on.Any idea on how we could fix this ? :)
The text was updated successfully, but these errors were encountered: