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

Support for derived types #55

Open
dselman opened this issue May 13, 2020 · 1 comment
Open

Support for derived types #55

dselman opened this issue May 13, 2020 · 1 comment

Comments

@dselman
Copy link
Contributor

dselman commented May 13, 2020

Feature Request πŸ›οΈ

In the Concerto model below the field Zoo.animals can contain any type that extends the abstract type Animal. Concerto-UI does not allow the user to select the type that they want to add to the array - it appears to pick the first non-abstract type.

It would be great if (when there is more than 1 abstract type that extends a base type) the UI allows the user to explicitly select the type (both for array and for non-arrays).

namespace acme

abstract concept Animal {
 o String name
}

concept Tiger extends Animal {
}

concept Lizard extends Animal {
}

concept Zoo {
   o Animal[] animals
}

Here is the JSON created by Concerto-UI:

{
  "$class": "acme.Zoo",
  "animals": [
    {
      "$class": "acme.Tiger",
      "name": "Tigger"
    }
  ]
}

Use Case

Editing of Concerto model instances that contain a type hierarchy.

Possible Solution

Note that the sample generation code in Concerto already includes some logic to pick non-abstract types.

@alsoarpit
Copy link

@dselman @jeromesimeon @martinhalford @DianaLease am working on it please can you assign me this issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants