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

Support for schema with patternProperties? #97

Open
askanium opened this issue May 16, 2024 · 1 comment
Open

Support for schema with patternProperties? #97

askanium opened this issue May 16, 2024 · 1 comment

Comments

@askanium
Copy link

First of all, thanks for an awesome library.

Are there any plans to support dynamic object properties defined with patternProperties?

For instance, here is a basic example:

{
  "type": "object",
  "patternProperties": {
    ".*": {
      "type": "string",
      "enum": ["READ", "WRITE", "ALL"]
    }
  }
}

This validates an object with any key that has a value from the enum. However, rendering the corresponding UI fails with the following error:

Schema of type 'object' must have at least one of these keys: ['properties' or 'keys' or 'oneOf' or 'anyOf' or 'allOf']
@kviktor
Copy link

kviktor commented Jun 25, 2024

Not really an answer to your question, but you can use additionalProperties to add previously undefined keys, it doesn't have a validation on the key value itself tho.

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