Open nirupbbnk opened 7 months ago
Quite an old issue, but I believe this will do what you want:
Schema:
properties: include('props', required=True, strict=False)
---
props:
context: include('cont', required=True)
---
cont:
type: str()
description: str()
This assumes your data is on the following form:
properties:
context:
type: string
description: A string value
other_key:
type: string
description: A string value
properties: caseID: type: string description: some description detailed_goal: type: string description: some description for goal context: type: string description: some description for context
This is my data , here i want to validate if map has key context , we want to check only if context is present , rest keys are dynamic and may change, We want to validate only context key is present , rest keys can be anything,
properties: map(key=regex('context'))
Currently I am using this , but validation fails as it has other keys , (as other keys are dynamic we can't have static value )