temecom
October 18, 2020, 12:36am
1
I am trying to use the application/hal+json format but keep getting:
{
“type”: “NotAcceptableException”,
“message”: “RESTEASY003635: No match for accept header”
}
Engine per: GitHub - camunda/docker-camunda-bpm-platform: Docker images for the camunda BPM platform
Is there a springboot configuration to enable HAL support?
Thanks
Chris
What API are you attempting to use? Have you made any configuration changes?
I’m able to pull and run camunda-bpm-platform:7.14.0
and camunda-bpm-platform:7.13.0
. The following request has a HAL response that I would expect
Request
curl --location --request GET ‘http://localhost:8080/engine-rest/task ’
–header ‘Accept: application/hal+json’
Response
{
"_links": {
"self": {
"href": "/task"
}
},
"_embedded": {...},
"count": 6
}
Hi, this is an old thread but since I am facing the same issue with the Spring Boot starter I thought I would describe my problem in here.
For me, I am getting the same response as OP when I am hitting the /user
and /group
endpoints (at the least, haven’t checked all endpoints). /task
returns a successful response on setting the accept header to application/hal+json
.
My response is a bit different though
{
"type": "NotAcceptableException",
"message": "HTTP 406 Not Acceptable"
}
I have done some digging and found the following:
The interface TaskRestService
has the following method
@GET
@Produces({MediaType.APPLICATION_JSON, Hal.APPLICATION_HAL_JSON})
Object getTasks(@Context Request request, @Context UriInfo uriInfo,
@QueryParam("firstResult") Integer firstResult, @QueryParam("maxResults") Integer maxResults);
The corresponding interface for User UserRestService
has the following method
@GET
@Produces(MediaType.APPLICATION_JSON)
List<UserProfileDto> queryUsers(@Context UriInfo uriInfo,
@QueryParam("firstResult") Integer firstResult, @QueryParam("maxResults") Integer maxResults);
As you can see the interface itself doesn’t define HAL handling. Consequently the implementation of this service doesn’t handle HAL too.