Book a Demo

Author Topic: How to tag attributes and connections as "required"  (Read 4954 times)

MrSnow

  • EA User
  • **
  • Posts: 20
  • Karma: +1/-0
    • View Profile
How to tag attributes and connections as "required"
« on: February 04, 2019, 08:47:51 pm »
Hi!

I am currently working on generating XSD's and JSON Schema's from existing class diagrams in EA. It is crucial for me to be able to tag certain elements and attributes as "required" for these schema's to work. I've tried different approaches to the Schema Composer and have just started playing with XSD export in EA. I'm as you probably would guess very new to EA, so if I'm misunderstanding something, please do correct me!

Does anybody know if there is any way I can tag/mark an attribute or element as "required" and get that information with me when exporting to XSD or JSON?

Thank you in advance!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to tag attributes and connections as "required"
« Reply #1 on: February 04, 2019, 09:33:30 pm »
Setting the lowerbound of the multiplicity to 1 should do.

Geert

MrSnow

  • EA User
  • **
  • Posts: 20
  • Karma: +1/-0
    • View Profile
Re: How to tag attributes and connections as "required"
« Reply #2 on: February 05, 2019, 11:28:28 pm »
Setting the lowerbound of the multiplicity to 1 should do.

Geert

I've set the lowerbound of the multiplicity to 1, but none of the schema types in the schema composer registers this info and puts it in the JSON. On some element attributes I actually get the:

"maxOccurs" : 1,
"minOccurs" : 1

In the JSON Schema generated with Generic. But most of my attributes doesn't get that information. Do you know why?
« Last Edit: February 06, 2019, 12:44:12 am by MrSnow »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to tag attributes and connections as "required"
« Reply #3 on: February 06, 2019, 03:53:13 pm »
Setting the lowerbound of the multiplicity to 1 should do.

Geert

I've set the lowerbound of the multiplicity to 1, but none of the schema types in the schema composer registers this info and puts it in the JSON. On some element attributes I actually get the:

"maxOccurs" : 1,
"minOccurs" : 1

In the JSON Schema generated with Generic. But most of my attributes doesn't get that information. Do you know why?
No, I have no idea. The JSON generation is a black box to me.

Geert