Book a Demo

Author Topic: Generate JSON schema syntax from a model  (Read 24921 times)

coeko50

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Generate JSON schema syntax from a model
« 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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Generate JSON schema syntax from a model
« Reply #1 on: August 07, 2014, 03:41:30 am »
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.

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Re: Generate JSON schema syntax from a model
« Reply #2 on: August 14, 2014, 08:55:50 am »
Quote
Hi, EA supports the generation of XSD schemas from within the tool but  we  using JSON. Has anybody generated JSON

A fine idea
Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.

wikitect

  • EA User
  • **
  • Posts: 117
  • Karma: +2/-0
    • View Profile
    • TRAK Community
Re: Generate JSON schema syntax from a model
« Reply #3 on: July 22, 2016, 09:12:02 pm »
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
======
Favourite epitaph: 'Under this sod lies another'

TRAK Framework https://sf.net/p/trak
MDG for TRAK https://sf.net/p/mdgfortrak

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Generate JSON schema syntax from a model
« Reply #4 on: July 23, 2016, 05:16:23 pm »
I think the new Schema Composer does JSON

Geert

wikitect

  • EA User
  • **
  • Posts: 117
  • Karma: +2/-0
    • View Profile
    • TRAK Community
Re: Generate JSON schema syntax from a model
« Reply #5 on: July 25, 2016, 02:55:04 am »
Yes, indeed this looks to be possible - see http://sparxsystems.com/downloads/whitepapers/the-schema-composer.pdf

Is it possible to then use a defined schema to export an entire model?
======
Favourite epitaph: 'Under this sod lies another'

TRAK Framework https://sf.net/p/trak
MDG for TRAK https://sf.net/p/mdgfortrak

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Generate JSON schema syntax from a model
« Reply #6 on: July 25, 2016, 05:06:49 pm »
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

Geert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Generate JSON schema syntax from a model
« Reply #7 on: June 18, 2019, 10:34:45 pm »
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/

Geert

jasen

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Generate JSON schema syntax from a model
« Reply #8 on: December 16, 2020, 04:59:15 am »
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?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Generate JSON schema syntax from a model
« Reply #9 on: December 16, 2020, 05:30:24 am »
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

jasen

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Generate JSON schema syntax from a model
« Reply #10 on: December 16, 2020, 09:15:49 pm »
Excellent, thanks for the quick response. I can now generate JSON schemas, very easy  :D

nathmaheshmp

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Generate JSON schema syntax from a model
« Reply #11 on: December 16, 2020, 11:46:14 pm »

Thanks for the quick reply:)