You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scrobot
changed the title
Support of a custom mapping in the field with different names
Support of a custom mapping in the fields with different names
Mar 11, 2023
scrobot
changed the title
Support of a custom mapping in the fields with different names
Support of a custom mapping to the fields with different names
Mar 11, 2023
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.
The text was updated successfully, but these errors were encountered: