0

I need to validate Python dicts that will have arbitrary names. When I attempt to validate them using Cerberus, I get unknown field. Is there a way of allowing for arbitrary dict names?

I was thinking that keysrules might work, but it appears to only work on items within the base dict.

{'account_created': {'category': 'Accounts',
                     'conversion_event': True,
                     'description': 'A new account is created'}
}

I would like to be able to use an arbitrary name where account_created is in this dict.

user584982
  • 25
  • 5

1 Answers1

0

Assuming you don't need to validate that base key, I just attempted to answer a question similar to this on the Cerberus GitHub. My suggestion was to maybe use a dynamically formed schema. You could follow the GitHub issue thread and see if anyone there comes up with a better answer.

Flargebla
  • 76
  • 3