From ad9b084c8f19b60924a78b1cf0e00fe53cdd5876 Mon Sep 17 00:00:00 2001 From: Jacob Baca Date: Thu, 11 Mar 2021 15:57:01 +0000 Subject: [PATCH 1/2] Revert "in schema, changed fields marked as numbers to singer.decimals (#86)" This reverts commit 5445f6fc1700236eb4381c66288d753d43913c24. --- .circleci/config.yml | 5 -- tap_shopify/schemas/abandoned_checkouts.json | 48 ++++++------ tap_shopify/schemas/definitions.json | 34 ++++----- tap_shopify/schemas/order_refunds.json | 15 ++-- tap_shopify/schemas/orders.json | 79 +++++++++----------- tap_shopify/schemas/products.json | 13 ++-- tap_shopify/schemas/transactions.json | 16 ++-- 7 files changed, 93 insertions(+), 117 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1d115b27..53e74cb3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,11 +20,6 @@ jobs: command: | source /usr/local/share/virtualenvs/tap-shopify/bin/activate make test - - run: - name: 'JSON Validator' - command: | - source /usr/local/share/virtualenvs/tap-tester/bin/activate - stitch-validate-json /usr/local/share/virtualenvs/tap-shopify/lib/python3.5/site-packages/tap_shopify/schemas/*.json - add_ssh_keys - run: name: 'Integration Tests' diff --git a/tap_shopify/schemas/abandoned_checkouts.json b/tap_shopify/schemas/abandoned_checkouts.json index 2926d4ea..771f1a27 100644 --- a/tap_shopify/schemas/abandoned_checkouts.json +++ b/tap_shopify/schemas/abandoned_checkouts.json @@ -66,9 +66,8 @@ "latitude": { "type": [ "null", - "string" - ], - "format": "singer.decimal" + "number" + ] }, "zip": { "type": [ @@ -127,9 +126,8 @@ "longitude": { "type": [ "null", - "string" - ], - "format": "singer.decimal" + "number" + ] } } }, @@ -159,9 +157,9 @@ "amount": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "code": { "type": [ @@ -222,9 +220,9 @@ "total_line_items_price": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "closed_at": { "type": [ @@ -266,16 +264,16 @@ "total_tax": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "subtotal_price": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "line_items": { "$ref": "definitions.json#/line_items" @@ -289,9 +287,9 @@ "total_discounts": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "note": { "type": [ @@ -351,9 +349,9 @@ "price": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "requested_fulfillment_service_id": { "type": [ @@ -448,9 +446,8 @@ "latitude": { "type": [ "null", - "string" - ], - "format": "singer.decimal" + "number" + ] }, "zip": { "type": [ @@ -509,9 +506,8 @@ "longitude": { "type": [ "null", - "string" - ], - "format": "singer.decimal" + "number" + ] } } }, @@ -533,9 +529,9 @@ "total_price": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "cart_token": { "type": [ diff --git a/tap_shopify/schemas/definitions.json b/tap_shopify/schemas/definitions.json index f1476040..6aea8017 100644 --- a/tap_shopify/schemas/definitions.json +++ b/tap_shopify/schemas/definitions.json @@ -11,9 +11,9 @@ "tax_amount": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "refund_id": { "type": [ @@ -24,9 +24,9 @@ "amount": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "kind": { "type": [ @@ -593,9 +593,8 @@ "amount": { "type": [ "null", - "string" - ], - "format": "singer.decimal" + "number" + ] } }, "type": [ @@ -617,9 +616,8 @@ "pre_tax_price": { "type": [ "null", - "string" - ], - "format": "singer.decimal" + "number" + ] }, "sku": { "type": [ @@ -636,9 +634,9 @@ "total_discount": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "name": { "type": [ @@ -682,9 +680,9 @@ "price": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "requires_shipping": { "type": [ @@ -830,9 +828,9 @@ "price": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "title": { "type": [ @@ -843,9 +841,9 @@ "rate": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "compare_at": { "type": [ diff --git a/tap_shopify/schemas/order_refunds.json b/tap_shopify/schemas/order_refunds.json index ac10d709..d05a153d 100644 --- a/tap_shopify/schemas/order_refunds.json +++ b/tap_shopify/schemas/order_refunds.json @@ -168,9 +168,8 @@ "total_tax": { "type": [ "null", - "string" - ], - "format": "singer.decimal" + "number" + ] }, "quantity": { "type": [ @@ -268,9 +267,8 @@ "rate": { "type": [ "null", - "string" - ], - "format": "singer.decimal" + "number" + ] } }, "type": [ @@ -652,9 +650,8 @@ "subtotal": { "type": [ "null", - "string" - ], - "format": "singer.decimal" + "number" + ] }, "restock_type": { "type": [ diff --git a/tap_shopify/schemas/orders.json b/tap_shopify/schemas/orders.json index 11fa6c7b..ac0a8b2a 100644 --- a/tap_shopify/schemas/orders.json +++ b/tap_shopify/schemas/orders.json @@ -1,4 +1,4 @@ - { +{ "properties": { "presentment_currency": { "type": [ @@ -15,9 +15,9 @@ "total_price": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "line_items": { "$ref": "definitions.json#/line_items" @@ -43,16 +43,16 @@ "total_discounts": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "total_line_items_price": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "order_adjustments": { "$ref": "definitions.json#/order_adjustments" @@ -74,9 +74,9 @@ "price": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "title": { "type": [ @@ -96,9 +96,8 @@ "amount": { "type": [ "null", - "string" - ], - "format": "singer.decimal" + "number" + ] } }, "type": [ @@ -120,9 +119,8 @@ "discounted_price": { "type": [ "null", - "string" - ], - "format": "singer.decimal" + "number" + ] }, "code": { "type": [ @@ -376,9 +374,9 @@ "total_tax": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "payment_details": { "properties": { @@ -471,9 +469,8 @@ "longitude": { "type": [ "null", - "string" - ], - "format": "singer.decimal" + "number" + ] }, "address2": { "type": [ @@ -514,9 +511,8 @@ "latitude": { "type": [ "null", - "string" - ], - "format": "singer.decimal" + "number" + ] }, "country_code": { "type": [ @@ -545,9 +541,9 @@ "total_price_usd": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "closed_at": { "type": [ @@ -610,9 +606,8 @@ "value": { "type": [ "null", - "string" - ], - "format": "singer.decimal" + "number" + ] } }, "type": [ @@ -652,9 +647,9 @@ "subtotal_price": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "billing_address": { "properties": { @@ -685,9 +680,8 @@ "longitude": { "type": [ "null", - "string" - ], - "format": "singer.decimal" + "number" + ] }, "address2": { "type": [ @@ -728,9 +722,8 @@ "latitude": { "type": [ "null", - "string" - ], - "format": "singer.decimal" + "number" + ] }, "country_code": { "type": [ @@ -804,9 +797,9 @@ "amount": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "type": { "type": [ @@ -1019,9 +1012,8 @@ "total_tax": { "type": [ "null", - "string" - ], - "format": "singer.decimal" + "number" + ] }, "restock_type": { "type": [ @@ -1032,9 +1024,8 @@ "subtotal": { "type": [ "null", - "string" - ], - "format": "singer.decimal" + "number" + ] } }, "type": [ diff --git a/tap_shopify/schemas/products.json b/tap_shopify/schemas/products.json index 63754715..a360991f 100644 --- a/tap_shopify/schemas/products.json +++ b/tap_shopify/schemas/products.json @@ -178,9 +178,9 @@ "price": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "image_id": { "type": [ @@ -221,9 +221,8 @@ "weight": { "type": [ "null", - "string" - ], - "format": "singer.decimal" + "number" + ] }, "inventory_management": { "type": [ @@ -252,9 +251,9 @@ "compare_at_price": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "updated_at": { "type": [ diff --git a/tap_shopify/schemas/transactions.json b/tap_shopify/schemas/transactions.json index bd9d321b..0d4e3eef 100644 --- a/tap_shopify/schemas/transactions.json +++ b/tap_shopify/schemas/transactions.json @@ -45,9 +45,9 @@ "amount": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "authorization": { "type": [ @@ -150,23 +150,23 @@ "fee_amount": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "gross_amount": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 }, "tax_amount": { "type": [ "null", - "string" + "number" ], - "format": "singer.decimal" + "multipleOf": 1e-10 } }, "patternProperties": {".+": {}} From e227e4bd5770391a2c9a042769ced82b4cbcaaac Mon Sep 17 00:00:00 2001 From: Jacob Baca Date: Thu, 11 Mar 2021 16:14:05 +0000 Subject: [PATCH 2/2] added singer.decimal only for number types that had multipleOf --- .circleci/config.yml | 5 +++ tap_shopify/schemas/abandoned_checkouts.json | 28 ++++++++--------- tap_shopify/schemas/definitions.json | 24 +++++++-------- tap_shopify/schemas/orders.json | 32 ++++++++++---------- tap_shopify/schemas/products.json | 8 ++--- tap_shopify/schemas/transactions.json | 16 +++++----- 6 files changed, 59 insertions(+), 54 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 53e74cb3..1d115b27 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,6 +20,11 @@ jobs: command: | source /usr/local/share/virtualenvs/tap-shopify/bin/activate make test + - run: + name: 'JSON Validator' + command: | + source /usr/local/share/virtualenvs/tap-tester/bin/activate + stitch-validate-json /usr/local/share/virtualenvs/tap-shopify/lib/python3.5/site-packages/tap_shopify/schemas/*.json - add_ssh_keys - run: name: 'Integration Tests' diff --git a/tap_shopify/schemas/abandoned_checkouts.json b/tap_shopify/schemas/abandoned_checkouts.json index 771f1a27..33285fa0 100644 --- a/tap_shopify/schemas/abandoned_checkouts.json +++ b/tap_shopify/schemas/abandoned_checkouts.json @@ -157,9 +157,9 @@ "amount": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "code": { "type": [ @@ -220,9 +220,9 @@ "total_line_items_price": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "closed_at": { "type": [ @@ -264,16 +264,16 @@ "total_tax": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "subtotal_price": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "line_items": { "$ref": "definitions.json#/line_items" @@ -287,9 +287,9 @@ "total_discounts": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "note": { "type": [ @@ -349,9 +349,9 @@ "price": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "requested_fulfillment_service_id": { "type": [ @@ -529,9 +529,9 @@ "total_price": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "cart_token": { "type": [ diff --git a/tap_shopify/schemas/definitions.json b/tap_shopify/schemas/definitions.json index 6aea8017..63da3737 100644 --- a/tap_shopify/schemas/definitions.json +++ b/tap_shopify/schemas/definitions.json @@ -11,9 +11,9 @@ "tax_amount": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "refund_id": { "type": [ @@ -24,9 +24,9 @@ "amount": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "kind": { "type": [ @@ -634,9 +634,9 @@ "total_discount": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "name": { "type": [ @@ -680,9 +680,9 @@ "price": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "requires_shipping": { "type": [ @@ -828,9 +828,9 @@ "price": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "title": { "type": [ @@ -841,9 +841,9 @@ "rate": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "compare_at": { "type": [ diff --git a/tap_shopify/schemas/orders.json b/tap_shopify/schemas/orders.json index ac0a8b2a..dc87ea7e 100644 --- a/tap_shopify/schemas/orders.json +++ b/tap_shopify/schemas/orders.json @@ -15,9 +15,9 @@ "total_price": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "line_items": { "$ref": "definitions.json#/line_items" @@ -43,16 +43,16 @@ "total_discounts": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "total_line_items_price": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "order_adjustments": { "$ref": "definitions.json#/order_adjustments" @@ -74,9 +74,9 @@ "price": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "title": { "type": [ @@ -374,9 +374,9 @@ "total_tax": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "payment_details": { "properties": { @@ -541,9 +541,9 @@ "total_price_usd": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "closed_at": { "type": [ @@ -647,9 +647,9 @@ "subtotal_price": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "billing_address": { "properties": { @@ -797,9 +797,9 @@ "amount": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "type": { "type": [ diff --git a/tap_shopify/schemas/products.json b/tap_shopify/schemas/products.json index a360991f..098c487e 100644 --- a/tap_shopify/schemas/products.json +++ b/tap_shopify/schemas/products.json @@ -178,9 +178,9 @@ "price": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "image_id": { "type": [ @@ -251,9 +251,9 @@ "compare_at_price": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "updated_at": { "type": [ diff --git a/tap_shopify/schemas/transactions.json b/tap_shopify/schemas/transactions.json index 0d4e3eef..bd9d321b 100644 --- a/tap_shopify/schemas/transactions.json +++ b/tap_shopify/schemas/transactions.json @@ -45,9 +45,9 @@ "amount": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "authorization": { "type": [ @@ -150,23 +150,23 @@ "fee_amount": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "gross_amount": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" }, "tax_amount": { "type": [ "null", - "number" + "string" ], - "multipleOf": 1e-10 + "format": "singer.decimal" } }, "patternProperties": {".+": {}}