Getting error while decoding : AttributeError: type object 'BaseHandler' has no attribute '_registry'
I am using jsonstruct to convert Sonar API response json to python classes but it is throwing type object 'BaseHandler' has no attribute '_registry'
Attached json file : sample json.txt
Using https://app.quicktype.io/ I am converting above json to @dataclasses
Dataclass name : dataclass.txt
Now the below code is giving the error:
e = jsonstruct.decode(json_string, SonarIssues.Welcome) print(e)
Exception stack trace -
e = jsonstruct.decode(json_string, SonarIssues.Welcome)
File "C:\python\lib\site-packages\jsonstruct_init_.py", line 127, in decode return j.restore(json.decode(string), cls) File "C:\python\lib\site-packages\jsonstruct\unpickler.py", line 95, in restore HandlerClass = handlers.BaseHandler._registry.get(cls_def) AttributeError: type object 'BaseHandler' has no attribute '_registry'