-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map product_id for a Product #761
Conversation
@@ -422,7 +423,7 @@ public String name() { | |||
} | |||
|
|||
public String id() { | |||
return getString(ID_KEY); | |||
return getString(ID_KEY) != null ? getString(ID_KEY) : getString(PRODUCT_ID_KEY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: do u think we should give first preference to product_id
and then fall back to id
or vice versa?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking was to give preference to id
over product_id
. This should not introduce any changes if a customer is sending both id
and product_id
. If a customer is sending both values you'd expect those values to be the same but you never know!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good
@@ -197,5 +197,9 @@ class PropertiesTest { | |||
assertThat(product.name()).isNull() | |||
product.putName("name") | |||
assertThat(product.name()).isEqualTo("name") | |||
|
|||
product.remove("id") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
As per below we do not check to see if a
product_id
is present and only map forid
#746