-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Define how properties with simple array type can be interpreted #14
Comments
I'm confused. This seems pretty straightforward to me. What other way other than the obvious could this be interpreted. |
I would say so myself, one question that might come up is simple arrays vs lists. Of course, some implementations might want to provide the option during the generation and not hardcoded. We just need to define the default 🙂 Regardless, created the task to ensure we have test cases for it 🙂 |
Ahhh, now I see what you mean. Generally, I think it should be an array except when it has |
What does this mean? Is this referring to a particular language's use of these terms? |
Did not even think about For the array type, would you not expect the simple array type by default in all languages, instead of a more advanced array type? For the vocabulary keyword, what would make sense to introduce, and any suggestions if we can make it language-agnostic? I can only think of non-agnostic variants. Non language-agnostic: Maybe as object:
In languages such as Java, we have simple arrays such as |
Not necessarily. In JSON Schema,
This shouldn't be a problem. We just have to make up our words and define them. Then implementations should translate those into whatever data structure most closely fits the definition in the target language. For Example,
This was good question because I had assumed "array" to mean anything iterable with sequential numeric indexing and "list" to mean a linked list data structure. |
We need to be careful that we don't specify things that languages don't have native support for. For instance, C/C++ defines arrays, but they don't define complex collection types. They can be created and included, but it's not built-in. I think the best we could do is follow @jdesrosiers suggestion and define our own words and let implementations decide what types best fit.
In C#, lists are iterable, but not necessarily a linked list data structure. The different between arrays and lists there is that arrays are statically allocated while lists are dynamically allocated. |
That's a good point, and there will definitely be multiple cases for this across the languages. Therefore suggestions per language are all we can do I think 🙂 And even suggest less restrictive types in certain scenarios 🤔 But yea, even there in the end it's the end users' choice which types they want to use, and they might vary from person to person tbh. |
We need to define how array type properties should be interpreted, such as for the following schema:
The text was updated successfully, but these errors were encountered: