Uh oh!
There was an error while loading. Please reload this page.
Add serializeToString() method - #213
Conversation
This will allow generating Json String documents out of the box from any of the response/request objects.
dadoonet
commented
Mar 21, 2022
@swallez I think we should try to think something even more useful. I'd love to have the method Instead of writing: SearchResponse<Person> resp = ...;
Stringjson = newJacksonJsonpMapper().serializeToString(resp);We could write: SearchResponse<Person> resp = ...;
Stringjson = resp.toJson();Would it be good for you? |
swallez
commented
Mar 24, 2022
I'd like to limit the number of framework-related methods on API classes to the bare minimum, and I don't expect |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…java Co-authored-by: Sylvain Wallez <sylvain@bluxte.net>
…java Co-authored-by: Sylvain Wallez <sylvain@bluxte.net>
frank-montyne
commented
Jun 27, 2022
I don't really agree with the quote of @swallez '...and I don't expect serializeToString to be widely used....' |
rharsh-arkin
commented
Mar 1, 2023
@dadoonet When can we expect this to get merged? |
dadoonet
commented
May 17, 2023
@swallez I think that we can now use: JsonpUtils.toJsonString(response, jacksonJsonpMapper);So should we close this one? |
dadoonet
commented
Apr 9, 2026
@l-trotta should we close this one? |
This method
serializeToString()helps to generate the json String representation of any response or request object.This could be useful for debugging or for other usages like consuming the search response objects within a JavaScript based frontend.