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
Enhanced JSON schema validation with checks for required and allowed child objects, type checking for field types including `primitive`, `compound` and `controlledVocabulary`. More user-friendly error messages to help pinpoint the issues in the dataset JSON. See [Retrieve a Dataset JSON Schema for a Collection](https://guides.dataverse.org/en/6.3/api/native-api.html#retrieve-a-dataset-json-schema-for-a-collection) in the API Guide and PR #10543.
Copy file name to clipboardExpand all lines: doc/sphinx-guides/source/api/native-api.rst
+17-5Lines changed: 17 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -566,9 +566,7 @@ The fully expanded example above (without environment variables) looks like this
566
566
Retrieve a Dataset JSON Schema for a Collection
567
567
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
568
568
569
-
Retrieves a JSON schema customized for a given collection in order to validate a dataset JSON file prior to creating the dataset. This
570
-
first version of the schema only includes required elements and fields. In the future we plan to improve the schema by adding controlled
571
-
vocabulary and more robust dataset field format testing:
569
+
Retrieves a JSON schema customized for a given collection in order to validate a dataset JSON file prior to creating the dataset:
572
570
573
571
.. code-block:: bash
574
572
@@ -593,8 +591,22 @@ While it is recommended to download a copy of the JSON Schema from the collectio
593
591
Validate Dataset JSON File for a Collection
594
592
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
595
593
596
-
Validates a dataset JSON file customized for a given collection prior to creating the dataset. The validation only tests for json formatting
597
-
and the presence of required elements:
594
+
Validates a dataset JSON file customized for a given collection prior to creating the dataset.
595
+
596
+
The validation tests for:
597
+
598
+
- JSON formatting
599
+
- required fields
600
+
- typeClass must follow these rules:
601
+
602
+
- if multiple = true then value must be a list
603
+
- if typeClass = ``primitive`` the value object is a String or a List of Strings depending on the multiple flag
604
+
- if typeClass = ``compound`` the value object is a FieldDTO or a List of FieldDTOs depending on the multiple flag
605
+
- if typeClass = ``controlledVocabulary`` the values are checked against the list of allowed values stored in the database
606
+
- typeName validations (child objects with their required and allowed typeNames are configured automatically by the database schema). Examples include:
607
+
608
+
- dsDescription validation includes checks for typeName = ``dsDescriptionValue`` (required) and ``dsDescriptionDate`` (optional)
609
+
- datasetContact validation includes checks for typeName = ``datasetContactName`` (required) and ``datasetContactEmail``; ``datasetContactAffiliation`` (optional)
0 commit comments