diff --git a/ckan/logic/action/create.py b/ckan/logic/action/create.py index 95660cfd095..aff9fc3f128 100644 --- a/ckan/logic/action/create.py +++ b/ckan/logic/action/create.py @@ -109,7 +109,10 @@ def package_create(context, data_dict): package_type = data_dict.get('type') package_plugin = lib_plugins.lookup_package_plugin(package_type) - schema = package_plugin.create_package_schema() + if 'schema' in context: + schema = context['schema'] + else: + schema = package_plugin.create_package_schema() _check_access('package_create', context, data_dict) diff --git a/ckan/logic/action/get.py b/ckan/logic/action/get.py index 236e1c3559f..c9a32a0ee93 100644 --- a/ckan/logic/action/get.py +++ b/ckan/logic/action/get.py @@ -721,7 +721,10 @@ def package_show(context, data_dict): item.read(pkg) package_plugin = lib_plugins.lookup_package_plugin(package_dict['type']) - schema = package_plugin.show_package_schema() + if 'schema' in context: + schema = context['schema'] + else: + schema = package_plugin.show_package_schema() if schema and context.get('validate', True): package_dict, errors = _validate(package_dict, schema, context=context) diff --git a/ckan/logic/action/update.py b/ckan/logic/action/update.py index cb0c7a35e1f..1923f8fd71d 100644 --- a/ckan/logic/action/update.py +++ b/ckan/logic/action/update.py @@ -233,7 +233,10 @@ def package_update(context, data_dict): # get the schema package_plugin = lib_plugins.lookup_package_plugin(pkg.type) - schema = package_plugin.update_package_schema() + if 'schema' in context: + schema = context['schema'] + else: + schema = package_plugin.update_package_schema() if 'api_version' not in context: # check_data_dict() is deprecated. If the package_plugin has a