I used to do this with XML back in the day. The idea is that you give your clients a schema and you should guarantee that you follow it, otherwise you might cause an error.
I agree with you though, Unit testing seem a better way of doing this for 99% of cases. You can imagine a complicated schema an a service which builds up a response with info from other ...
You might be able to use content-type parameters as in
I don't know whether adding user-defined parameters is officially blessed, but as long as you're talking between your own pieces of software who is going to punish you?
I think your question may have been answered over at Stack Overflow. It involves using the http://json-schema.org/ spec for designing your JSON and converting it with https://github.com/joelittlejohn/jsonschema2pojo. Not sure if the github repo needs any updates for the current version of Java, but it might give you a good starting point.
When object serialization is involved a Data Transfer Object (as you mentioned) gives you the flexibility you need to mirror the JSON structure in an object oriented language. Each tech stack has a way to parse JSON into specific data formats (int's, strings, floats, structs, complex objects, arrays, etc).
Once you have the DTO you are free to map this to ...