Skip to content

Commit

Permalink
explain reason behind discriminator prioritization
Browse files Browse the repository at this point in the history
  • Loading branch information
robbertvanwaveren committed May 12, 2023
1 parent 53ee1e9 commit e7e2914
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ public int compareTo(MappedModel other) {
return -1;
}

// prioritize mappings based on the spec before any auto-generated class-name based
// so that during serialization the proper values are used in the json
final boolean mappedEqualsModelName = getMappingName().equals(getModelName());
if (mappedEqualsModelName != other.getMappingName().equals(other.getModelName())) {
return mappedEqualsModelName ? 1 : -1;
Expand Down

0 comments on commit e7e2914

Please sign in to comment.