Open RobAley opened 5 years ago
Just to add that I noticed when playing around this json also throws a similar error in bigquery(), but I know nothing of / don't use bigquery so I can't speculate whether a fix is needed there :
generate-schema/src/schemas/bigquery.js:28 Uncaught (in promise) TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at processFields (generate-schema/src/schemas/bigquery.js:28)
at generate-schema/src/schemas/bigquery.js:37
at Array.map (<anonymous>)
at processFields (generate-schema/src/schemas/bigquery.js:28)
at generate-schema/src/schemas/bigquery.js:37
at Array.map (<anonymous>)
at processFields generate-schema/src/schemas/bigquery.js:28)
at generate-schema/src/schemas/bigquery.js:37
at Array.map (<anonymous>)
The following json (partial from the github api) :
throws the following error when converting to mysql :
as Utils.isTimestamp() doesn't like nulls instead of strings. Changing line 92 of mysql.js from :
to
seems to fix this, and the type for null fields like this (signature and payload in the example json above) becomes string, which in my case is the correct handling.
I haven't submitted a pull request as I'm not sure that this is the correct handling in all cases / the generic case, and I don't know enough about the code to know if it will cause any other unintended side effects.
Thanks for a great library.