swh.model.fields.compound module#

swh.model.fields.compound.validate_against_schema(model, schema, value)[source]#

Validate a value for the given model against the given schema.

  • model – the name of the model

  • schema – the schema to validate against

  • value – the value to validate


True if the value is correct against the schema


ValidationError if the value does not validate against the schema

swh.model.fields.compound.validate_all_keys(value, keys)[source]#

Validate that all the given keys are present in value

swh.model.fields.compound.validate_any_key(value, keys)[source]#

Validate that any of the given keys is present in value