Skip to content

Commit

Permalink
transfer cardinality to property from items array
Browse files Browse the repository at this point in the history
  • Loading branch information
cweedall committed May 7, 2024
1 parent 7ea5482 commit 8b54684
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/main/java/edu/isi/oba/MapperDataProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,20 @@ private ArraySchema arraySchema(Schema base) {

base = this.getSchemaRestrictions(base);

// Can this be done in a better way?
Integer minItemsInteger = base.getMinItems();
if (minItemsInteger != null) {
base.setMinItems(null);
array.setMinItems(minItemsInteger);
}

// Can this be done in a better way?
Integer maxItemsInteger = base.getMaxItems();
if (maxItemsInteger != null) {
base.setMaxItems(null);
array.setMaxItems(maxItemsInteger);
}

array.setNullable(this.nullable);
array.setItems(base);

Expand Down

0 comments on commit 8b54684

Please sign in to comment.