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

ComponentAttribute: automatically set type property #229

Open
viennem opened this issue Sep 7, 2023 · 0 comments
Open

ComponentAttribute: automatically set type property #229

viennem opened this issue Sep 7, 2023 · 0 comments

Comments

@viennem
Copy link
Member

viennem commented Sep 7, 2023

ComponentAttributes have a type property that must reflect the type of their value property.

Currently, this type property must be set by each plugin's parser.
This is not ideal for a few reasons:

  1. Duplication of the logic to reflect the type from the value in each plugin.
  2. Plugin writers need to know which type to use, which is not very obvious (types must all start by an uppercase character, attributes with a definitions of type Object or Link must be of type Array, ...).
  3. This property can be computed automatically from the value, so it is somewhat redundant.

We should determine if we can to move this concern to leto-modelizer-plugin-core, instead of plugins.

It could be done for example in the constructor of ComponentAttribute, or a get function to automatically compute the type from the value.

@viennem viennem moved this to 📋 Backlog in Board of Leto-modelizer Sep 7, 2023
@viennem viennem changed the title ComponentAttribute: automatically set attribute type ComponentAttribute: automatically set type property Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant