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

Array supports the use of Componenet #181

Open
chanhyupkim opened this issue Apr 8, 2024 · 2 comments
Open

Array supports the use of Componenet #181

chanhyupkim opened this issue Apr 8, 2024 · 2 comments

Comments

@chanhyupkim
Copy link

For flexible modeling, I would like to use a pre-defined Componenet in Array. Why are the following formats not supported, and do you have any plans to support them in the future?

{
"@type": "Telemetry",
"name": "ledState",
"schema": {
"@type": "Array",
"elementSchema": "Component"
}
}

@rido-min
Copy link
Member

rido-min commented Apr 8, 2024

Components allow to create composable interfaces by referencing another interface.

Arrays allow to describe a message with a sequence of different elements in the same message.

What is the use case to create an Array of Components?

Maybe, updating your example with a concrete interface that will be used as a component will help us to understand your requirement.

@chanhyupkim
Copy link
Author

chanhyupkim commented Apr 8, 2024

If the Array is supported to have a Component format, it has the advantage of being able to plug-in multiple models in a Component format by defining a single model. As it is not currently supported, it is cumbersome to create a model in a separate Object format under the Array when defining multiple models (the same code must be rewritten)

In addition, it would be good to support defining the component within the component for the same reason.

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

No branches or pull requests

2 participants