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

How to create a uiSchema for patternProperties? #1514

Closed
ktalebian opened this issue Nov 17, 2019 · 1 comment
Closed

How to create a uiSchema for patternProperties? #1514

ktalebian opened this issue Nov 17, 2019 · 1 comment

Comments

@ktalebian
Copy link

I'm trying to make a schema for the following JSON blob:

{
  "extensionUniqueId": {
    "default": {
      "name": "The first extension",
      "src": "/path/to/extension1"
    }
  },
  "extensionUniqueId2": {
    "default": {
      "name": "The second extension",
      "src": "/path/to/extension2"
    }
  }
}

I've created the following schema:

{
    "title": "Extensions",
    "type": "object",
    "patternProperties": {
        ".*": {
            "title": "Extension",
            "type": "object",
            "required": [
                "default"
            ],
            "properties": {
                "default": {
                    "title": "Default",
                    "type": "object",
                    "required": [
                        "src",
                        "name"
                    ],
                    "properties": {
                        "src": {
                            "title": "Source/URL",
                            "description": "The URL extension",
                            "type": "string"
                        },
                        "name": {
                            "title": "Name",
                            "description": "The extension Name",
                            "type": "string"
                        }
                    }
                }
            }
        }
    }
}

But I cannot figure out how to set the uiSchema since the property names are patterns.

@epicfaace
Copy link
Member

uiSchema is rather limited at the moment and doesn't support patternProperties -- it only supports named properties. Merging this with #701.

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