Can swagger-codegen generate java model toString methods with pretty json format #11275
kotapavan92
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello All,
I have recently started working in java. Model files generated using swagger-codegen Version 3.0.27 have a toString method which has the below lines. This creates a string but doesn't print in a pretty-json format.
ObjectMapper mapper = new ObjectMapper();
jsonStr = mapper.writeValueAsString(this);
I was wondering why the below line wasn't considered to be added to create a pretty-json? And if it is possible to also include the below line to the method? It would be a
mapper.configure(SerializationFeature.INDENT_OUTPUT, true);
It would be great to have this enhancement in the future releases.
Please let me know if Versions 3.0.28 or higher already have this enhancement!
Thanks,
Pavan
Beta Was this translation helpful? Give feedback.
All reactions