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

[Feature]: Support patternProperties in JSON Schema helpers #1189

Closed
edgarrmondragon opened this issue Nov 15, 2022 · 0 comments · Fixed by #1197
Closed

[Feature]: Support patternProperties in JSON Schema helpers #1189

edgarrmondragon opened this issue Nov 15, 2022 · 0 comments · Fixed by #1197

Comments

@edgarrmondragon
Copy link
Collaborator

Feature scope

Taps (catalog, state, stream maps, etc.)

Description

From the JSON Schema docs:

Pattern Properties

Sometimes you want to say that, given a particular kind of property name, the value should match a particular schema. That’s where patternProperties comes in: it maps regular expressions to schemas. If a property name matches the given regular expression, the property value must validate against the corresponding schema.

This should be easy to add to the ObjectType class:

sdk/singer_sdk/typing.py

Lines 445 to 452 in eed6736

class ObjectType(JSONTypeHelper):
"""Object type, which wraps one or more named properties."""
def __init__(
self,
*properties: Property,
additional_properties: W | type[W] | None = None,
) -> None:

@edgarrmondragon edgarrmondragon changed the title [Feature]: Support patternProperties [Feature]: Support patternProperties in JSON Schema helpers Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant