-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Hello
I'm having some problem while using catnap with Springboot it seems that the DefaultModelBuilder is getting stuck while filtering the object, it goes into an endless loop while and eventually throws an exeption
This is the JSON I get if i make the request without filtering
{ "status": 200, "result": { "id": 1, "email": "miguel.soares@email.com", "username": "miguel", "enabled": true, "roles": [ { "createdAt": 1516725487432, "updatedAt": 1516725487432, "id": 3, "name": "ROLE_USER" } ] } }
When trying to get only the result like so
curl -X GET 'http://localhost:8081/api/users/1?fields=result'
I get this:
{ "timestamp": 1516784320900, "status": 500, "error": "Internal Server Error", "exception": "java.lang.StackOverflowError", "message": "No message available", "path": "/api/users/1" }
The Java output are endless lines of this:
at com.github.gregwhitaker.catnap.core.model.builder.DefaultModelBuilder.filterObject(DefaultModelBuilder.java:140) ~[catnap-core-2.2.1.jar:na] at com.github.gregwhitaker.catnap.core.model.builder.DefaultModelBuilder.buildObject(DefaultModelBuilder.java:104) ~[catnap-core-2.2.1.jar:na] at com.github.gregwhitaker.catnap.core.model.builder.DefaultModelBuilder.buildList(DefaultModelBuilder.java:70) ~[catnap-core-2.2.1.jar:na] at com.github.gregwhitaker.catnap.core.model.builder.DefaultModelBuilder.filterObject(DefaultModelBuilder.java:140) ~[catnap-core-2.2.1.jar:na]
I also find it interesting that it does work if i for example request the username inside the result like ?fields=result(username)