schema-guru
schema-guru copied to clipboard
Consider a way to handle nested objects
Here's a sample JSON file http://coderextreme.net/SeaStarGroup.json [here's the license for this file: http://x3dgraphics.com/examples/X3dForWebAuthors/license.html ]. I will download schema-guru try this unless you get to me soon.
Hey @coderextreme you can try out schema-guru here (http://schemaguru.snowplowanalytics.com/). As for the JSON you supplied it does appear to have successfully produced a JsonSchema.
Yeah, I just tried it. It produced a JSON schema, but if you look, Transforms are specified over and over. We just want one Transform object/attribute in the schema I think, if possible. Do we need to redesign the JSON? It's pretty much decided that they are nested, but we may be able to do some math to only have one transform. But we also allow nested Groups, so...
If one could specify a JSON schema to start derived from an XML Schema, like one from Jsonix Schema Compiler or JAXB/Jsonix, or conversion from OWL, I think that would work better. In this case, our attribute names, arrays and comments have a prefix, @, - or #, so I don't think that would work without some coding. Or if I could take 2 schemas with similar names and copy the names from the schema with the prefix to the schema without the prefix, that would be wonderful.
Ugh, too many transforms.
John
On Nov 6, 2015, at 12:49 AM, Josh [email protected] wrote:
Hey @coderextreme https://github.com/coderextreme you can try out schema-guru here (http://schemaguru.snowplowanalytics.com/ http://schemaguru.snowplowanalytics.com/). As for the JSON you supplied it does appear to have successfully produced a JsonSchema.
— Reply to this email directly or view it on GitHub https://github.com/snowplow/schema-guru/issues/118#issuecomment-154328878.
Hi @coderextreme! Sorry for late reply, I missied this issue somehow. Unfortunately (if I understand everything correct) that is not possible now to derive these nested objects as separate subschemas. Although it would be a nice feature to have, at the same time it's hard to implement and not corresponds with our current needs. I'll schedule it as far-out milestone, but I couldn't promise it will be implemented.
I'm pretty sure it could be implemented with a map or dynamic object.