how to define a custom_type_resolver for a nested mapping #111
Unanswered
zakerzadeh
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a mapping like below
obj = {
'item':{
'item_num':'123',
'item_name':'xyz',
'contacts':{[
{
I have also defined a custome type_resolver like below
def _custom_type_resolver_tmp(name):
if name == 'item':
return rule_engine.DataType.MAPPING
elif name =='item.item_num':
return rule_engine.DataType.STRING
elif name == 'item.contacts':
return rule_engine.DataType.ARRAY
elif name == 'item.contacts.role':
return rule_engine.DataType.STRING
but I keep getting an error
TypeError: unhashable type: 'list'
wondering if defining such a nested mapping is possible?
Beta Was this translation helpful? Give feedback.
All reactions