'Json schema validation in Spring REST APIs

I’m building a REST API using Spring Boot and [jackson-module-jsonSchema] (https://github.com/FasterXML/jackson-module-jsonSchema) for JSON schema generation. I’m looking the best way to validate the request JSON payload arriving to my APIs endpoints (Spring controllers) against the defined JSON schema defined for the exposed resource, validation includes check required fields , format , min and max values, etc.. everything we can validate against the schema.

Seems jackson json schema module is useful for schema generation but not for validation, am I right? Any suggestion on how to achieve what I’m trying to do?



Solution 1:[1]

You can also look at Rest Assured Json Schema validator

https://www.baeldung.com/rest-assured-json-schema

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ankush Puri