We need to Store some JSON messages which has to follow schema that we are going to process (from a Java Application, if that matters). The concern is the schema can also be evolved over time and we need to make sure the new schema is backwards compatible with the previous schema so any messages written using the old schema can be translated to the new schema.
Eg, assume this json is as a whole served from an API. in the POST /v1 endpoint we stored the json message with schema v1 which was returned from GET /V1.
then we upgrade the schema to V2 and also update the API to /v2. but the messages that was stored using the POST /v1 (with schema V1) endpoint should be able to be served from GET /v2 endpoint.
we can keep the copies of the schema versions for the validation. is there a way (may be a maven target that can be combined to build target) so the latest schema version is checked for backwards compatibility against the previous version. this way we can prevent some developer making a breaking change to the schema