Skip to content
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

Correct abandoned_checkouts schema to correctly reflect some properties as arrays #44

Merged

Conversation

airhorns
Copy link
Contributor

@airhorns airhorns commented Aug 6, 2019

Before this change, I was unable to extract the abandoned checkouts stream because of JSONSchema validation errors. This fixes that such that the stream can be extracted!

  • note_attributes is an array of objects with keys name and value. See https://help.shopify.com/en/api/reference/orders/order for docs on this property confusingly.
  • line_items[x].applied_discounts is also an array of objects. It's been superseded by the discount_applications field on the root level objects, but because it was specified in the schema as an object instead of an array records were failing schema validation. This will render those records valid, but not actually type and validate the properties of the field, which should keep the behaviour after this commit as similar as possible to the behaviour before.
  • shipping_lines[x].custom_tax_lines and shipping_lines[x].applied_discounts get a similar treatment. Because they are supplied as arrays in the incoming data they need to be specified as such, but in order to not break anything and discourage using these deprecated fields, they aren't fully specified.

airhorns and others added 2 commits August 6, 2019 10:04
…es as arrays

 - `note_attributes` is an array of objects with keys name and value. See https://help.shopify.com/en/api/reference/orders/order for docs on this property confusingly.
 - `line_items[x].applied_discounts` is also an array of objects. It's been superseded by the `discount_applications` field on the root level objects, but because it was specified in the schema as an object instead of an array records were failing schema validation. This will render those records valid, but not actually type and validate the properties of the field, which should keep the behaviour after this commit as similar as possible to the behaviour before.
 - `shipping_lines[x].custom_tax_lines` and `shipping_lines[x].applied_discounts` get a similar treatment. Because they are supplied as arrays in the incoming data they need to be specified as such, but in order to not break anything and discourage using these deprecated fields, they aren't fully specified.
@zachharris1 zachharris1 merged commit c031afa into singer-io:master May 19, 2021
@airhorns airhorns deleted the abandoned-checkouts-schema-fixes branch May 19, 2021 15:02
@zachharris1 zachharris1 mentioned this pull request May 19, 2021
2 tasks
tmck-code pushed a commit to lexerdev/tap-shopify that referenced this pull request Feb 3, 2022
…es as arrays (singer-io#44)

- `note_attributes` is an array of objects with keys name and value. See https://help.shopify.com/en/api/reference/orders/order for docs on this property confusingly.
 - `line_items[x].applied_discounts` is also an array of objects. It's been superseded by the `discount_applications` field on the root level objects, but because it was specified in the schema as an object instead of an array records were failing schema validation. This will render those records valid, but not actually type and validate the properties of the field, which should keep the behaviour after this commit as similar as possible to the behaviour before.
 - `shipping_lines[x].custom_tax_lines` and `shipping_lines[x].applied_discounts` get a similar treatment. Because they are supplied as arrays in the incoming data they need to be specified as such, but in order to not break anything and discourage using these deprecated fields, they aren't fully specified.

Co-authored-by: zachharris1 <69470481+zachharris1@users.noreply.github.com>
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.

None yet

2 participants