Skip to content

Commit

Permalink
Adding new fields in schemas (#35)
Browse files Browse the repository at this point in the history
* Adding new fields in schemas (#34)

Co-authored-by: Mario Molina <[email protected]>

* TDL-13968: Removed dublicacy of all Ref schemas.

* TDL-13968: Removed duplicate fields from the JSON.

Co-authored-by: Mario Molina <[email protected]>
Co-authored-by: dbshah1212 <[email protected]>
Co-authored-by: Kyle Allan <[email protected]>
  • Loading branch information
4 people authored Aug 25, 2021
1 parent 54a05ff commit 52183d2
Show file tree
Hide file tree
Showing 25 changed files with 325 additions and 1,786 deletions.
6 changes: 5 additions & 1 deletion tap_quickbooks/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,14 @@ def do_discover():
))
# Set the replication_key MetaData to automatic as well
mdata = metadata.write(mdata, ('properties', stream.replication_keys[0]), 'inclusion', 'automatic')
ref_schema = singer.utils.load_json(
os.path.normpath(
os.path.join(_get_abs_path("schemas/ref_schema.json"))))
refs = {"ref_schema.json": ref_schema}
catalog_entry = {
"stream": stream_name,
"tap_stream_id": stream_name,
"schema": schema,
"schema": singer.resolve_schema_references(schema, refs),
"metadata": metadata.to_list(mdata),
"key_properties": stream.key_properties
}
Expand Down
21 changes: 5 additions & 16 deletions tap_quickbooks/schemas/accounts.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,15 @@
]
},
"CurrencyRef": {
"properties": {
"name": {
"type": [
"null",
"string"
]
},
"value": {
"type": [
"null",
"string"
]
}
},
"$ref": "ref_schema.json"
},
"Name": {
"type": [
"null",
"object"
"string"
]
},
"Name": {
"Description": {
"type": [
"null",
"string"
Expand Down
114 changes: 6 additions & 108 deletions tap_quickbooks/schemas/bill_payments.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,10 @@
],
"properties": {
"APAccountRef": {
"properties": {
"name": {
"type": [
"null",
"string"
]
},
"value": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
"$ref": "ref_schema.json"
},
"DepartmentRef": {
"properties": {
"name": {
"type": [
"null",
"string"
]
},
"value": {
"type": [
"null",
"string"
]
}
},
"type": [
"null",
"object"
]
"$ref": "ref_schema.json"
},
"CheckPayment": {
"type": [
Expand All @@ -51,24 +17,7 @@
],
"properties": {
"BankAccountRef": {
"type": [
"null",
"object"
],
"properties": {
"name": {
"type": [
"null",
"string"
]
},
"value": {
"type": [
"null",
"string"
]
}
}
"$ref": "ref_schema.json"
},
"PrintStatus": {
"type": [
Expand All @@ -79,24 +28,7 @@
}
},
"CurrencyRef": {
"type": [
"null",
"object"
],
"properties": {
"name": {
"type": [
"null",
"string"
]
},
"value": {
"type": [
"null",
"string"
]
}
}
"$ref": "ref_schema.json"
},
"TotalAmt": {
"type": [
Expand Down Expand Up @@ -147,24 +79,7 @@
}
},
"VendorRef": {
"type": [
"null",
"object"
],
"properties": {
"name": {
"type": [
"null",
"string"
]
},
"value": {
"type": [
"null",
"string"
]
}
}
"$ref": "ref_schema.json"
},
"domain": {
"type": [
Expand All @@ -179,24 +94,7 @@
],
"properties": {
"CCAccountRef": {
"type": [
"null",
"object"
],
"properties": {
"name": {
"type": [
"null",
"string"
]
},
"value": {
"type": [
"null",
"string"
]
}
}
"$ref": "ref_schema.json"
}
}
},
Expand Down
Loading

0 comments on commit 52183d2

Please sign in to comment.