Open scrobot opened 1 year ago
Just run into this with REST API dictionaries that include a self
key (that's the canonical URL back for the object) which is unusable as a field name in dataclasses and get you errors like:
SyntaxError: duplicate argument 'self' in function definition
An alternative to the decorator implementation would be to use field(metadata=...)
, but either could work.
I have one common problem. My model/entity has a field that might be related to the DTO but with different naming and type.
I'm of opinion that the best way to resolve this problem would be to add some customization to the mapping
Or maybe apply some "magic" :) but I'm not pretty sure) Just for the thinking about.