nijikokun / generate-schema

🧞 Convert JSON Objects to MySQL, JSON Schema, Mongoose, Google BigQuery, Swagger, and more.
MIT License
1.04k stars 136 forks source link

TypeError: Cannot convert undefined or null to object #70

Open Alex-1557 opened 1 year ago

Alex-1557 commented 1 year ago

Unfortunately, your program don' working

 bigquery.js:28
   return Object.keys(data).map(function (key) {
                 ^
 TypeError: Cannot convert undefined or null to object
     at Function.keys (<anonymous>)
     at processFields (G:\Projects\CryptoChestMax\AngularClient\CryptochestFront\CryptochestFront\node_modules\generate-schema\src\schemas\bigquery.js:28:17)
     at G:\Projects\CryptoChestMax\AngularClient\CryptochestFront\CryptochestFront\node_modules\generate-schema\src\schemas\bigquery.js:37:22
     at Array.map (<anonymous>)
     at processFields (G:\Projects\CryptoChestMax\AngularClient\CryptochestFront\CryptochestFront\node_modules\generate-schema\src\schemas\bigquery.js:28:28)
     at Object.Process [as bigquery] (G:\Projects\CryptoChestMax\AngularClient\CryptochestFront\CryptochestFront\node_modules\generate-schema\src\schemas\bigquery.js:45:10)  
     at ReadStream.<anonymous> (G:\Projects\CryptoChestMax\AngularClient\CryptochestFront\CryptochestFront\node_modules\generate-schema\bin\generate-schema:130:52)
     at ReadStream.emit (node:events:513:28)
     at endReadableNT (node:internal/streams/readable:1358:12)
     at processTicksAndRejections (node:internal/process/task_queues:83:21)

This is example to reproduce this issue.

{ "value": { "error": [ "mke2fs 1.45.6 (20-Mar-2020)", "" ], "result": [ "Discarding device blocks: 4096/5242880\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b\b\b\b\bdone ", "Creating filesystem with 5242880 4k blocks and 1310720 inodes", "Filesystem UUID: 587eaaa2-5507-4d29-8ad4-ba9e0deff05e", "Superblock backups stored on blocks: ", "\t32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, ", "\t4096000", "", "Allocating group tables: 0/160\b\b\b\b\b\b\b \b\b\b\b\b\b\bdone ", "Writing inode tables: 0/160\b\b\b\b\b\b\b \b\b\b\b\b\b\bdone ", "Creating journal (32768 blocks): done", "Writing superblocks and filesystem accounting information: 0/160\b\b\b\b\b\b\b \b\b\b\b\b\b\bdone", "", "" ] }, "formatters": [ ], "contentTypes": [ ], "declaredType": null, "statusCode": 200 }