Skip to content

Commit

Permalink
Fixes #126
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed May 13, 2024
1 parent e1bde46 commit fc57ffe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ public Schema schema(String type) {
return this.schemas.get(type);
}

public Schema anySchema() {
return this.schemas.getOrDefault(EntityType.SP.getType(),
this.schemas.values().stream().findAny().orElseThrow(IllegalAccessError::new));
}

public ObjectMapper getObjectMapper() {
return objectMapper;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public MetaData prePut(MetaData previous, MetaData newMetaData, AbstractUser use
boolean eq = mapEquality(previousData, newData) && mapEquality(newData, previousData);
if (eq) {
//we need a schema, does not matter for which entityType
Schema schema = metaDataAutoConfiguration.schema(EntityType.RP.getType());
Schema schema = metaDataAutoConfiguration.anySchema();
throw new ValidationException(schema, "No data is changed. An update would result in an empty revision", "empty-revision");
}
return super.prePut(previous, newMetaData, user);
Expand Down

0 comments on commit fc57ffe

Please sign in to comment.