Ticket #2893 (new defect)

Opened 20 months ago

Tags missing from form_to_db_package_schema()

Reported by: seanh Owned by:
Priority: awaiting triage Milestone: ckan-v1.8.1
Component: ckan Keywords:
Cc: Repository: ckan
Theme: none

Description

With an IDatasetForm plugin active with a form_to_db_package_schema() method that returns a schema based on ckan/logic/schema.py:form_to_db_package_schema() I'm getting validation errors like this:

[ckan.controllers.api] Validation error: "{'type': 'Validation Error', 'junk': [u'The input field junk was not expected.']}"

They seem to be caused when a data dict with key 'tags' is passed to e.g. the package_update API, for example in ckan/tests/functional/api/model/test_vocabulary.py there are various tests that get this error when they call package_update (if you run the tests with a suitable IDatasetForm plugin active).

In ckan/logic/schema.py:form_to_db_package_schema() 'tags' is for some reason deliberately removed from the schema.

Note: See TracTickets for help on using tickets.