quicktype throws ' quicktype cannot infer this type because there is no data about it in the input.' #3113
|
A bit of noob here with JSON and schema (I grew up in the XML realm....). I have two very simple JSON schema files - address.json and person.json (attached). Here's the 'quicktype' cmd: c:\programs\quicktype\quicktype ^ At the end of the quicktype run, it throws the following message: Issue in line 18: quicktype cannot infer this type because there is no data about it in the input. this is in the 'output/models.hpp' file - the only real line of code in that file.
In the end I have a good-sized pile of JSON schema files, they all follow the pattern of the original 'address.json' file. What to do? thanks! |
Replies: 1 comment
|
Ok, figgered this out. There's a longer story here about updating/refreshing existing applications and those applications currently use XML with XSD schema defs and they're being updated to use JSON and JSON schema defs, blah, blah, blah. I started on this project with a big pile of already generated JSON schema files and attempted to create C++ and Java classes from them for the application upgrade. QuickType had some problems with that pile of JSON schema files so I started from scratch (from the XSD schema files and created my own JSON schema files). I'll post samples of what I produced and how I invoke QuickType, but first some notes:
Here's my 'schemaDocument.json', which just references the real top level structures. 'topLevelType1.json': quickType invocation (using CMake): Party on. |
Ok, figgered this out. There's a longer story here about updating/refreshing existing applications and those applications currently use XML with XSD schema defs and they're being updated to use JSON and JSON schema defs, blah, blah, blah.
I started on this project with a big pile of already generated JSON schema files and attempted to create C++ and Java classes from them for the application upgrade. QuickType had some problems with that pile of JSON schema files so I started from scratch (from the XSD schema files and created my own JSON schema files).
I'll post samples of what I produced and how I invoke QuickType, but first some notes: