Json schema validation in Spring REST APIs
You can also look at Rest Assured Json Schema validator
https://www.baeldung.com/rest-assured-json-schema
If you take a look at JSON schema site, there are only two libraries for validation in Java.
- The one that Jorge Campos suggested is mature, but looking for new maintainer: https://github.com/fge/json-schema-validator
- Second one is relatively new: http://github.com/everit-org/json-schema
I was recently in situation where I had to choose one or the other and I picked first option. It is being used also by Rest Assured library under the hood.