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

Add anyOf/oneOf inside a property #1332

Closed
janechu opened this issue Jan 22, 2019 · 0 comments · Fixed by #1367
Closed

Add anyOf/oneOf inside a property #1332

janechu opened this issue Jan 22, 2019 · 0 comments · Fixed by #1367
Assignees
Labels
feature A new feature

Comments

@janechu
Copy link
Collaborator

janechu commented Jan 22, 2019

What feature are you requesting?

The use of an anyOf/oneOf inside a property, and not just the root level of the schema.

What would be the benefit of adding this feature?

This would allow further flexibility in schema creation as well we the ability to create select dropdowns with a different label than its value which is the default when using an enum. See rjsf-team/react-jsonschema-form#532. the issue with adding another array to the listed items is that it is an addition to JSON schema that was not intended.

example schema with a oneOf:

{
    "type": "object",
    "properties": {
        "strings": {
            "type": "array",
            "items": {
                "oneOf": [
                    {
                        "title": "a",
                        "type": "string",
                    },
                    {
                        "title": "b",
                        "type": "string",
                    }
                ]
            }
        }
    }
}
@janechu janechu self-assigned this Jan 22, 2019
@triage-new-issues triage-new-issues bot added the status:triage New Issue - needs triage label Jan 22, 2019
@janechu janechu added the feature A new feature label Jan 24, 2019
@triage-new-issues triage-new-issues bot removed the status:triage New Issue - needs triage label Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant