ModelServerClient.getAll() has compile-time type (string | string[]) but different runtime type (object). #43
Replies: 2 comments
-
[Martin Fleck] Hello @hoelzl-florian(hoelzl-florian) , thank you for reporting that! I can confirm that we have a wrong return type here. From the server we get a map from Model URI to EObject but that is not properly reflected in the API. I created an issue to track that: eclipse-emfcloud/emfcloud-modelserver-theia#20. I believe we should get a fix in sometime this week, early next week. If you need the proper behavior in the meantime you can probably parse the returned string using |
Beta Was this translation helpful? Give feedback.
-
[hoelzl-florian] Thanks, for Your reply. I' am currently using Object.keys().forEach().I'll post a suggestion for fixing to the issue You mentioned in a few seconds. |
Beta Was this translation helpful? Give feedback.
-
Checking the type of response.body returned by a call to the model server client API getAll() returns that the type is an 'object'. In contrast, the compile-time / API return type is 'string | string[]'. When I query the model server directly
using the browser URL 'http://localhost:8081/api/v1/models', I get a success response and 'response.data' contains
my model starting with its URI as the key.
Therefore my question is: how can I access the model data tree returned by the model server when using the ModelServerClient.getAll().
original thread by hoelzl-florian
Beta Was this translation helpful? Give feedback.
All reactions