c93207addb
When a property has 'alias' defined, and it's not present in instance, if the alias property is present, add the property with value from alias property before remove the alias property from instance. Examples: with schema: { "$schema": "http://json-schema.org/draft-04/schema#", "title": "Pungi Configuration", "type": "object", "properties": { "release_name": {"type": "string", "alias": "product_name"}, }, "required": ["release_name"], "additionalProperties": False, } 1. config = {"release_name": "dummy product"}: validate pass, config not changed after validation. 2. config = {"product_name": "dummy product"}: validate pass, config updated to the following after validation: config: {"release_name": "dummy product"} 3. config = {"name": "dummy product"}: validate fail, errror message is "Failed validation in : 'release_name' is a required property", and warning message is "WARNING: Unrecognized config option: name." 4. config = {"product_name": "dummy product", "release_name": "dummy product"} validate fail, error message is "Failed validation in : product_name is an alias of release_name, only one can be used." Signed-off-by: Qixiang Wan <qwan@redhat.com> |
||
---|---|---|
.. | ||
data | ||
fixtures | ||
__init__.py | ||
helpers.py | ||
test_arch.py | ||
test_buildinstall.py | ||
test_checks.py | ||
test_compose.py | ||
test_compose.sh | ||
test_config_validate_script.py | ||
test_config.py | ||
test_createiso_phase.py | ||
test_createiso_script.py | ||
test_createrepo_wrapper.py | ||
test_createrepophase.py | ||
test_extra_files_phase.py | ||
test_gather.py | ||
test_imagebuildphase.py | ||
test_imagechecksumphase.py | ||
test_initphase.py | ||
test_koji_wrapper.py | ||
test_linker.py | ||
test_liveimagesphase.py | ||
test_livemediaphase.py | ||
test_lorax_wrapper.py | ||
test_media_split.py | ||
test_metadata.py | ||
test_notifier.py | ||
test_osbs_phase.py | ||
test_ostree_installer_phase.py | ||
test_ostree_phase.py | ||
test_ostree_script.py | ||
test_pathmatch.py | ||
test_paths.py | ||
test_phase_base.py | ||
test_pkgset_pkgsets.py | ||
test_pkgset_source_koji.py | ||
test_repoclosure_wrapper.py | ||
test_scm.py | ||
test_test_phase.py | ||
test_unified_isos.py | ||
test_util.py |