When SchemaCrawler outputs a JSON-encoded version of the schema which contains only one table, the JSON syntax is violated for any empty arrays and objects in the table object:
This does not occur when the schema contains more than one table, or when the schema contains no tables. I suspect that the issue lies in the JSON serialization code:
No matter how SchemaCrawler ends up selecting exactly one table or view (either because there is only one entity of the chosen -tabletypes present in the database, or a RegularExpressionRule/-tables ends up filtering the set to only one entity), its behaviour is as described above.
The debug logs show no interesting differences between the normal case (the database has two views, or two tables, or one view and one table) and the problem case (the database has one table).
Because we consume the JSON programmatically, our current workaround is to select more than one view.
Environment
Issue encountered with:
com.microsoft.sqlserver.jdbc.SQLServerDriver
(6.4.0.jre8)Issue reproduced with:
org.postgresql.Driver
(9.4)Issue
When SchemaCrawler outputs a JSON-encoded version of the schema which contains only one table, the JSON syntax is violated for any empty arrays and objects in the table object:
Note the
[] []
and the{} {}
.This does not occur when the schema contains more than one table, or when the schema contains no tables. I suspect that the issue lies in the JSON serialization code:
-tabletypes
present in the database, or aRegularExpressionRule
/-tables
ends up filtering the set to only one entity), its behaviour is as described above.Because we consume the JSON programmatically, our current workaround is to select more than one view.