I'm currently using Voluptuous to validate JSON objects that are passed between different AWS lambda functions. My expectation is that the data that's passed between the lambda's in question will migrate over time.
Currently I'm appending a version string to each schema object after creation. so
I think it would be more convenient to have schema versions using a similar principle to the extend method for the schema class right now. So, for example, you would be able to say something like
lambda_schema = voluptuous.Schema({ ... }, version="0.1.0")
lambda_schema.add_version(voluptuous.Schema({ ... }, version="0.1.1")
lambda_schema(test_record, version="0.1.1") # passes in this example
lambda_schema(test_record, version="0.1.0") # fails
The use case would be a supported method of tracking schema migrations over time built into the library itself.
I'm currently using Voluptuous to validate JSON objects that are passed between different AWS lambda functions. My expectation is that the data that's passed between the lambda's in question will migrate over time.
Currently I'm appending a version string to each schema object after creation. so
I think it would be more convenient to have schema versions using a similar principle to the
extend
method for the schema class right now. So, for example, you would be able to say something likeThe use case would be a supported method of tracking schema migrations over time built into the library itself.