-
-
Notifications
You must be signed in to change notification settings - Fork 239
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
Handling of JSON Schema oneOf
#373
Comments
Hi @MrSaints. You mean SimoleSchema or JSON Schema? I’m not sure as title and link are a bit misleading. |
@radekmie, JSON Schema. But I take it that it behaves in the frontend similar to how Simple Schema behaves (because they're just adapters) ? |
Yep, true - I just wanted to be sure. I think it'll work with specified fields - |
@radekmie Ah OK! Yeah, I tried it, and it only returns the first "object" in a JSON schema |
So you have multiple types of objects, not completely different types? EDIT: Could you post an example of how you've tested it? |
@radekmie Something like below:
When rendered using |
Well, this one will be tricker. The one solution I see right now is to create a custom field. Example: const NthTypeObjectField = props =>
<AutoFields fields={Object.keys(props.field.oneOf[props.N].properties)} />
;
<NthTypeObjectField name="test" N={0} /> EDIT: I didn't test it. |
No response so far; I assume it's working. I'm closing but if it's not working - we'll continue digging in. |
Sorry for the late response. I didn't give it a try yet, but I'm sure if I tinkered with the low-level components, I could get something out of it. I was just wondering if it was already there out-of-the-box. Thanks anyway. |
In terms of UI, I take it that currently, only the first 'type' is shown in a
oneOf
, is that right?If so, are there any plans to display multiple types? I can imagine having a switch that determines which type is shown in the UI.
The text was updated successfully, but these errors were encountered: