Bug report
dataset-finch1.json
When including license information in a dataset json file (see the above attached file), the file does not validate.
1. Describe your environment
2. Actual behaviour:
When reading in a dataset json file ds.from_json(read_file(ds_filename)) (the one attached to this issue), I get the following errors:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/sah/Library/Python/3.9/lib/python/site-packages/pyDataverse/models.py", line 855, in from_json
validate_data(json_dict, filename_schema, file_format="json")
File "/Users/sah/Library/Python/3.9/lib/python/site-packages/pyDataverse/utils.py", line 451, in validate_data
validate(instance=data, schema=read_json(filename_schema))
File "/Users/sah/Library/Python/3.9/lib/python/site-packages/jsonschema/validators.py", line 1302, in validate
raise error
jsonschema.exceptions.ValidationError: {'name': 'CC0 1.0', 'uri': 'http://creativecommons.org/publicdomain/zero/1.0'} is not of type 'string'
Failed validating 'type' in schema['properties']['datasetVersion']['properties']['license']:
{'$id': '#/properties/datasetVersion/properties/license',
'type': 'string'}
On instance['datasetVersion']['license']:
{'name': 'CC0 1.0',
'uri': 'http://creativecommons.org/publicdomain/zero/1.0'}
3. Expected behaviour:
This file does successfully create a dataset with the correct license when using the API via command line (curl). This command works:
curl -H "X-Dataverse-key:$API_TOKEN" -X POST "$SERVER_URL/api/dataverses/$PARENT/datasets" --upload-file dataset-finch1.json -H 'Content-type:application/json
Bug report
dataset-finch1.json
When including license information in a dataset json file (see the above attached file), the file does not validate.
1. Describe your environment
2. Actual behaviour:
When reading in a dataset json file
ds.from_json(read_file(ds_filename))(the one attached to this issue), I get the following errors:3. Expected behaviour:
This file does successfully create a dataset with the correct license when using the API via command line (curl). This command works:
curl -H "X-Dataverse-key:$API_TOKEN" -X POST "$SERVER_URL/api/dataverses/$PARENT/datasets" --upload-file dataset-finch1.json -H 'Content-type:application/json