How to use oneOf in JSON and generate java objects with Jackson

Viewed 217

{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "additionalProperties": false, "oneOf":[{"$ref":"request1.json#"},{"$ref":"request2.json#"}] }

We want the request to check for any one of the JSON schema and throw error if the request does not match. But with Jackson, there is no validation happening and no check. Can someone help how to use oneOf with jsonschema2pojo maven plugin and use java classes ?

0 Answers
Related