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

schemafy_lib: semi-handle patternProperties #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

woodruffw
Copy link

@woodruffw woodruffw commented Aug 25, 2023

First of all, thanks for this library!

This is a first-stab attempt at supporting patternProperties, which were silently ignored before (more accurately, resulted in ZSTs).

The new behavior here is to degrade to a BTreeMap if the defined structure contains any patternProperties, since the presence thereof indicates dynamic key names that we can't represent/generate statically. Similarly, we use Value for the value type, since we need to cover everything that might be a valid value under either patternProperties or ordinary properties.

This could be improved slightly by making the value type into an enum of the closure of all possible value types in the actual schema, but I figured I'd start with this.

@woodruffw woodruffw mentioned this pull request Nov 22, 2023
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

Successfully merging this pull request may close these issues.

1 participant