I am currently using Jersey and Jackson to create a REST service. Right now, when the Resource method creates the / json application and returns the POJO, it correctly serializes the object in JSON and returns a response to the client.
Now I want to configure Jersey, so when a request arrives (for example, "indent"), I can say that Jackson will serialize JSON in a "nicer format, for example, indented." You can easily say that Jackson did this by setting up a JSON carpper with SerializationConfig.Feature.INDENT_OUTPUT.
The question is, how can I get a request on demand and use it to modify Jackson's output file?
source share