Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b6ZEVHGaYy15HAxRzy
15 lines
542 B
Java
15 lines
542 B
Java
//JAVA 25+
|
|
//DEPS tools.jackson.core:jackson-databind:3.3.0
|
|
|
|
import tools.jackson.databind.SerializationFeature;
|
|
import tools.jackson.databind.json.JsonMapper;
|
|
|
|
/** Reads JSON on stdin, writes it back pretty-printed. A tiny jq-lite in one file. */
|
|
public class Pretty {
|
|
public static void main(String[] args) throws Exception {
|
|
var mapper = JsonMapper.builder().enable(SerializationFeature.INDENT_OUTPUT).build();
|
|
var tree = mapper.readTree(System.in);
|
|
System.out.println(mapper.writeValueAsString(tree));
|
|
}
|
|
}
|