Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: coeko50 on August 07, 2014, 03:28:27 am
-
Hi, EA supports the generation of XSD schemas from within the tool but we using JSON. Has anybody generated JSON
-
Haven't read anything related here. But you can tweak the the code generation to create JSON (I guess). At least you would be able to do it via automation.
q.
-
Hi, EA supports the generation of XSD schemas from within the tool but we using JSON. Has anybody generated JSON
A fine idea
-
The built in SpiderMonkey JavaScript Engine is 7 years old and doesn't support JSON ... http://sparxsystems.com/forums/smf/index.php/topic,31211.0.html (http://sparxsystems.com/forums/smf/index.php/topic,31211.0.html)
-
I think the new Schema Composer does JSON
Geert
-
Yes, indeed this looks to be possible - see http://sparxsystems.com/downloads/whitepapers/the-schema-composer.pdf (http://sparxsystems.com/downloads/whitepapers/the-schema-composer.pdf)
Is it possible to then use a defined schema to export an entire model?
-
In theory it is, but it might be a bit slow.
I wrote a script a while ago to add a complete data model into the schema composer: https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library/blob/master/Projects/Project%20A/Temp/SetPackageToSchema.vbs (https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library/blob/master/Projects/Project%20A/Temp/SetPackageToSchema.vbs)
Geert
-
For those still interested in this. I just finished the first version of an add-in that supports modelling and generating JSON Schema.
See https://bellekens.com/ea-json/ (https://bellekens.com/ea-json/)
Geert
-
Fairly soon I am going to need to generate some JSON schemas. Don't know much about them yet but I tried Mr Belleken's JSON's EA plug in. It looks good but every time I try to generate a JSON schema I get an error:
EA JSON (EAJSON.EAJSONAddin)
"EA_MenuClick:Invalid URI: The URI is empty"
Is the plug-in trying to validate my schema and not finding a Schema attribute and URI?
I tried to implement the same schema as in the EAJSON example on the plug in web page but had the same problem. I've tried with EA V12.0 and EA V15.
What am I doing wrong, has anyone else tried this plugin?
-
Hmm, I think I'm going to add issue to the webpage (and I should probably catch that exception and return a more user friendly error message) ???
The problem is that the tagged value "id" in your JSONSchema element is empty.
Fill that with "http://example.com" and the error should disappear.
Geert
-
Excellent, thanks for the quick response. I can now generate JSON schemas, very easy :D
-
Thanks for the quick reply:)