eclipse-emfcloud / emfjson-jackson

emfjson-jackson
Other
16 stars 15 forks source link

Why my json has incomplete URIs for Eclasses? #4

Closed ftomassetti closed 2 years ago

ftomassetti commented 3 years ago

I am getting this JSON:

{
  "eClass" : "#//Result",
  "root" : {
    "eClass" : "#//CompilationUnit",
    "statements" : [ {
      "eClass" : "#//VarDeclaration",
      "initialValue" : {
        "eClass" : "#//StringLiteral",
        "value" : "foo"
      },
      "name" : "a"
    }, {
      "eClass" : "#//VarDeclaration",
      "initialValue" : {
        "eClass" : "#//StringLiteral",
        "value" : "bar"
      },
      "name" : "b",
      "visibility" : "PRIVATE"
    } ]
  },
  "issues" : [ {
    "message" : "lex",
    "position" : {
      "start" : {
        "line" : 1,
        "column" : 1
      },
      "end" : {
        "line" : 2,
        "column" : 10
      }
    }
  }, {
    "message" : "foo"
  } ]
}

I would expect the EClasses to have complete URIs, based on the URI of the containing packages instead of having the form #//Result". Is there something I should do to get that result?

martin-fleck-at commented 2 years ago

@ftomassetti How are you getting this JSON? From what I can see we use the full eClass-URI (EcoreUtil.getURI) by default, as specified in the EcoreTypeInfo of the EMFModule. If no URI has been specified anywhere elseYou can adapt the serialization of the type by specifying a different type info, see CustomSerializersTest.

ftomassetti commented 2 years ago

I am afraid I do not remember: it was close to an year ago. I have re-encounter the issue I will comment here

martin-fleck-at commented 2 years ago

@ftomassetti Absolutely understandable and thank you for your fast response!

eneufeld commented 2 years ago

Please feel free to reopen if issue persists.