Skip to content

Commit

Permalink
chore(irs-api):[#357] Add json aliases to relationship aspects
Browse files Browse the repository at this point in the history
  • Loading branch information
ds-jhartmann committed Apr 11, 2024
1 parent d2f8834 commit 66d46ac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.Optional;
import java.util.Set;

import com.fasterxml.jackson.annotation.JsonAlias;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
Expand Down Expand Up @@ -121,7 +122,9 @@ private boolean thereIsQuantity() {
@Jacksonized
/* package */ static class Quantity {

@JsonAlias({ "quantityNumber", "value" })
private Double quantityNumber;
@JsonAlias({ "measurementUnit", "unit" })
private Object measurementUnit;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.util.Optional;
import java.util.Set;

import com.fasterxml.jackson.annotation.JsonAlias;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
Expand Down Expand Up @@ -119,7 +120,9 @@ public Relationship toRelationship(final String catenaXId) {
@Data
@Jacksonized
/* package */ static class PartQuantity {
@JsonAlias({ "quantityNumber", "value" })
private Double quantityNumber;
@JsonAlias({ "measurementUnit", "unit" })
private String measurementUnit;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.util.Optional;
import java.util.Set;

import com.fasterxml.jackson.annotation.JsonAlias;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand Down Expand Up @@ -128,7 +129,9 @@ private boolean thereIsQuantity() {
@Jacksonized
/* package */ static class Quantity {

@JsonAlias({ "quantityNumber", "value" })
private Double quantityNumber;
@JsonAlias({ "measurementUnit", "unit" })
private String measurementUnit;

}
Expand Down

0 comments on commit 66d46ac

Please sign in to comment.