Skip to content

Conversation

@niallzato
Copy link
Contributor

As per below we do not check to see if a product_id is present and only map for id
#746


public String id() {
return getString(ID_KEY);
return getString(ID_KEY) != null ? getString(ID_KEY) : getString(PRODUCT_ID_KEY);
Copy link
Contributor

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?

Copy link
Contributor Author

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!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good

product.putName("name")
assertThat(product.name()).isEqualTo("name")

product.remove("id")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@niallzato niallzato merged commit b089df7 into master Apr 7, 2021
@prayansh prayansh deleted the niall/map_product_id branch April 9, 2021 00:32
@prayansh prayansh mentioned this pull request May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants