Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModelServerClient.getAll() has compile-time type (string | string[]) but different runtime type (object). #20

Closed
martin-fleck-at opened this issue Nov 17, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@martin-fleck-at
Copy link
Contributor

As mentioned on Spectrum [1] the getAll of the client has an incorrect return type and should return a map-like structure that maps from file URI to object.

[1] https://spectrum.chat/emfcloud/modelserver/modelserverclient-getall-has-compile-time-type-string-string-but-different-runtime-type-object~f85ffe9d-1639-4bb4-9f01-6b600d9bf626

@martin-fleck-at martin-fleck-at added the bug Something isn't working label Nov 17, 2020
@hoelzl-florian
Copy link

I suggest to introduce a wrapper object that resembles EMF's Resource class, like this:
{
modelUri : string,
eContent : object[]
}
Then getAll() simply returns an array of these objects and everybody can access each model's URI and content statically.
This abolishes any use of Object.entries or Object.keys on the result of getAll().

martin-fleck-at added a commit that referenced this issue Nov 26, 2020
- Add missing method for listing model uris: getModelUris
-- Add to example API test menu

- Ensure getAll returns a list of model
-- Introduce dedicated model type with modelUri and content properties

- Clean up code and use more types

Signed-off-by: Martin Fleck <mfleck@eclipsesource.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants