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
While running Yoga on a spring boot application using yoga-springmvc & yoga-core lib v1.06, I faced this issue where the response returned by JsonSelectorView was always coming as empty like "{}" in case of a POST method which is taking an input with @RequestBody spring annotation.
Details:-
I tried it with a very simple POJO having a @core annotation over a prepopulated spring attribute.
The API / Controller (& NOT @RestController as suggested) details were like this:- @RequestMapping((value = "/data", method = RequestMethod.POST)
public TestDTO getData( @RequestBody DataRequestDTO dataReq)
The same method starting giving result after removing the @RequestBody annotation while taking entity as input through POST method.
I could verify the same by debugging yoga where in while rendering the jsonview the model was showing the type as input request dto instead of the out going test dto and value as empty.
Not sure like @ResponseBody-which is prohibited to be used by Yoga, @RequestBody is also messing with the view rendering or if it is a known issue.
Let me know if more info is required around the config or POJOs to reproduce this.
The text was updated successfully, but these errors were encountered:
While running Yoga on a spring boot application using yoga-springmvc & yoga-core lib v1.06, I faced this issue where the response returned by JsonSelectorView was always coming as empty like "{}" in case of a POST method which is taking an input with @RequestBody spring annotation.
Details:-
I tried it with a very simple POJO having a @core annotation over a prepopulated spring attribute.
The API / Controller (& NOT @RestController as suggested) details were like this:-
@RequestMapping((value = "/data", method = RequestMethod.POST)
public TestDTO getData( @RequestBody DataRequestDTO dataReq)
The yoga config was done as exactly mentioned here : https://github.com/skyscreamer/yoga/wiki/Tutorial:-SpringMVC
The same method starting giving result after removing the @RequestBody annotation while taking entity as input through POST method.
I could verify the same by debugging yoga where in while rendering the jsonview the model was showing the type as input request dto instead of the out going test dto and value as empty.
Not sure like @ResponseBody-which is prohibited to be used by Yoga, @RequestBody is also messing with the view rendering or if it is a known issue.
Let me know if more info is required around the config or POJOs to reproduce this.
The text was updated successfully, but these errors were encountered: