You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inventory dataset form: optional field gives json export error if left blank #5434
When adding a resource in inventory dataset form, if the field "Format", which is marked optiojnal, is left blank, it gives an error during json export.
How to reproduce
add a resource to a dataset
choose "Link to a file" as the resource type, leave the format field blank.
to reproduce locally, you must include a url to a dataset that has no extension in the url and clear out format. when you do that, exporting the data.json will make a zip with an errorlog.txt that may look like this:
// errorlog.txt
2026-06-05 20:06:40,495 - ===================================================
Validation failed, best guess of error:
'mediaType' is a required property
Failed validating 'required' in schema[0]['dependencies']['downloadURL']:
{'properties': {'mediaType': {'anyOf': [{'pattern': '^[-\\w]+/[-\\w]+(\\.[-\\w]+)*([+][-\\w]+)?$',
'type': 'string'},
{'pattern': '^(\\[\\[REDACTED).*?(\\]\\])$',
'type': 'string'}]}},
'required': ['mediaType']}
On instance:
{'@type': 'dcat:Distribution',
'downloadURL': 'http://json-schema.org/draft-04/schema'}
For this dataset:
2026-06-05 20:06:40,498 - Dataset id=[ac1f331e-0de6-48f0-a949-9153e9b870a2], title=[test], organization=[top level publisher] omitted, reason above.
// error in terminal
ckan-1 | 2026-06-05 20:06:39,428 WARNI [ckanext.datajson.package2pod] Missing mediaType for resource in package ['ac1f331e-0de6-48f0-a949-9153e9b870a2']
all prs merged, I just need someone to login to inventory for me to verify the dataset http://json-schema.org/draft-04/schema will now successully export
Activity
cody-seibert-gsa commentedon Jun 5, 2026
to reproduce locally, you must include a url to a dataset that has no extension in the url and clear out format. when you do that, exporting the data.json will make a zip with an errorlog.txt that may look like this:
this pr fixes it GSA/ckanext-datajson#164
cody-seibert-gsa commentedon Jun 9, 2026
all prs merged, I just need someone to login to inventory for me to verify the dataset http://json-schema.org/draft-04/schema will now successully export
cody-seibert-gsa commentedon Jun 10, 2026
verified it's fixed with @FuhuXia on prod