eclipse-emfcloud / emfjson-jackson

emfjson-jackson
Other
16 stars 15 forks source link

`@ExtendedMetaData` name ambiguity #54

Closed janhicken closed 1 year ago

janhicken commented 1 year ago

When dealing with XML and Ecore models, that are generated from an XML schema definition (XSD), the following example can occcur:

<foo bar="42">
  <bar baz="hello"/>
</foo>

Here, the element <foo> has both an attribute as well as a child element called bar. A derived Ecore model would have two features, where of those has a counter appended to remove ambiguity:

interface Foo {
  /* Has @ExtendedMetadata(name="bar") */
  int getBar();

  /* Has @ExtendedMetadata(name="bar") */
  Bar getBar1();
}

The JSON mapper, however, will only serialize one of the two features listed above, because it does not resolve the ambiguity of feature names.