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

Multi select of Enumerables not supported. #347

Closed
Yeganloo opened this issue Aug 15, 2017 · 2 comments
Closed

Multi select of Enumerables not supported. #347

Yeganloo opened this issue Aug 15, 2017 · 2 comments

Comments

@Yeganloo
Copy link

Enums are Key Value paired or Mapped names.
for example in the old implementation of you schema the index of array (Key) is mapper to Enum name (Value). the only problem is that this numerical mapping is sequential (you can not enumerate like 0-> "default" , 5 -> "on", -5 -> "of") and string -> string mapping is impossible!
just change array to object. no extra key is needed also parsing and readability is better!
for example:

{
"enum": {
"Left eye": 1,
"Right eye": 2,
}
}

#57 solution is const!
There is a problem with Const solution. when you use oneOf keyword, it will map to SelectList or Radio button, but what about the time you want to use a checklist?
In recent example, there is 2 other choice: None and Both!
in such simple one, it's not a problem to add these 2 choices to enum but what will happen if we have more options?
multi select is the only executable solution and it is not covered by oneOf

@handrews
Copy link
Contributor

@Yeganloo since your question is about UI rendering, you should take a look at the UI Schema vocabulary project. The kick-off issue is here, in the repo for new vocabularies: json-schema-org/json-schema-vocabularies#2 and we welcome new issues on specific topics. This repository is just for the basic validation/hypermedia specifications.

@handrews
Copy link
Contributor

@Yeganloo I'm going to close this out of this repository, but please do feel free to open it in the vocabularies repository for the UI schema.

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