Key validation on arbitrary number of properties.
I'm working on validating an object where:
Keys should match the format:
Where:
- Some property keys are known and expected.
- Other extra/unknown keys are allowed only if they follow a specific pattern.
Keys should match the format:
metafield.<namespace>.<key> Where:
andnamespace
can contain alphanumeric characters, underscores, or hyphens.key
Example payload:
Question:
How can I define a Arktype type that allows:- Some known, explicitly typed keys.
- And any number of extra keys that match the regex pattern above?