Missing "eClass" attribute in models created by Model Server #151
Replies: 1 comment
-
This question is also related to Jackson serialization ( https://emfjson.github.io/projects/jackson/latest/ ) and XMI serialization. When you create with the Java EMF API, you seem to only create a detached model (unless there is a resource you didn't mention). If you want a deeper analysis of your issue, please attach :
In case you want the "eClass" attribute from a client with json (be it Java or Typescript), you will have to rely on the containing reference's EType (hence have the parent's EClass, recursively if needed, the containing reference name, and knowing its type in the schema). |
Beta Was this translation helpful? Give feedback.
-
I'm currently integrating my Model Server with the Theia Tree editor and I'm finding difficult to classify the information in my model coming from the Model Server. From what I see in the Coffee editor example, the attribute "eClass" is used in several places to know more about a node, i.e. in the label provider:
if I take a look on one of the example models provided by the Model Server project (SuperBrewer3000.json) I can see that the "eClass" is provided almost everywhere for each object:
On my side, I created a sample instance of my model using the Java auto-generated EMF API (from *.ecore file) by means of the ModelFactory.eINSTANCE.createMyObjects() and later called the ModelServerClient API for creating a new model in my workspace:
The result, not sure why, is a file in the workspace with XMI format (?).
When retrieving the model from the Model Server, the result is correct but the "eClass" parameter only appears on the root node, even though the object contains other objects of different classes.
Is this a problem on the default Codecs used for serializing the objects? Is it expected to see the "eClass" attribute on all properties of a model?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions