Skip to content

Commit

Permalink
scayle#1: Fixing data model bugs related to JSON parsing exception by…
Browse files Browse the repository at this point in the history
… Gson.
  • Loading branch information
Alireza Khatami Doost committed Apr 25, 2024
1 parent b9981dc commit 056b174
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class AppliedReduction implements ApiObjectInterface {
*
*/
@SerializedName("amount")
Object amount;
AppliedReductionAmount amount;

/**
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.scayle.storefrontapi.model;

import com.google.gson.annotations.SerializedName;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class AppliedReductionAmount implements ApiObjectInterface {
@SerializedName("absoluteWithTax")
Double absoluteWithTax;
@SerializedName("relative")
Double relative;
}
32 changes: 1 addition & 31 deletions src/main/java/com/scayle/storefrontapi/model/Product.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class Product implements ApiObjectInterface {
*
*/
@SerializedName("categories")
List<ProductCategory> categories;
List<List<ProductCategory>> categories;

/**
*
Expand All @@ -55,12 +55,6 @@ public class Product implements ApiObjectInterface {
@SerializedName("images")
List<Image> images;

/**
*
*/
@SerializedName("customData")
Map<String, CustomData> customData;

/**
* Identifies whether a product is active or not
*/
Expand Down Expand Up @@ -91,30 +85,12 @@ public class Product implements ApiObjectInterface {
@SerializedName("firstLiveAt")
String firstLiveAt;

/**
*
*/
@SerializedName("pricePromotionInfo")
Object pricePromotionInfo;

/**
*
*/
@SerializedName("priceRange")
PriceRange priceRange;

/**
*
*/
@SerializedName("reductionRange")
ReductionRange reductionRange;

/**
*
*/
@SerializedName("lowestPriorPrice")
LowestPriorPrice lowestPriorPrice;

/**
*
*/
Expand Down Expand Up @@ -151,10 +127,4 @@ public class Product implements ApiObjectInterface {
@SerializedName("updatedAt")
OffsetDateTime updatedAt;

/**
*
*/
@SerializedName("indexedAt")
OffsetDateTime indexedAt;

}
6 changes: 0 additions & 6 deletions src/main/java/com/scayle/storefrontapi/model/Variant.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ public class Variant implements ApiObjectInterface {
@SerializedName("stock")
Stock stock;

/**
*
*/
@SerializedName("customData")
Map<String, CustomData> customData;

/**
*
*/
Expand Down

0 comments on commit 056b174

Please sign in to comment.