Skip to content

Commit

Permalink
Added: typeClass field to DatasetFieldType payload
Browse files Browse the repository at this point in the history
  • Loading branch information
GPortas committed Jan 17, 2024
1 parent 462d8f7 commit 2adbabb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions doc/release-notes/10216-metadatablocks.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
The API endpoint `/api/metadatablocks/{block_id}` has been extended to include the following fields:

- `isRequired` - Whether or not this field is required
- `displayOrder`: The display order of the field in create/edit forms
- `isRequired`: Whether or not this field is required
- `displayOrder`: The display order of the field in create/edit forms
- `typeClass`: The type class of this field ("controlledVocabulary", "compound", or "primitive")
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,7 @@ public static JsonObjectBuilder json(DatasetFieldType fld) {
fieldsBld.add("displayName", fld.getDisplayName());
fieldsBld.add("title", fld.getTitle());
fieldsBld.add("type", fld.getFieldType().toString());
fieldsBld.add("typeClass", typeClassString(fld));
fieldsBld.add("watermark", fld.getWatermark());
fieldsBld.add("description", fld.getDescription());
fieldsBld.add("multiple", fld.isAllowMultiples());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ void testGetCitationBlock() {
.statusCode(OK.getStatusCode())
.body("data.fields.subject.controlledVocabularyValues[0]", CoreMatchers.is("Agricultural Sciences"))
.body("data.fields.title.displayOrder", CoreMatchers.is(0))
.body("data.fields.title.typeClass", CoreMatchers.is("primitive"))
.body("data.fields.title.isRequired", CoreMatchers.is(true));
}

Expand Down

0 comments on commit 2adbabb

Please sign in to comment.