Skip to content

Direction of serialisation (and kwarg cls overloaded incorrectly) should be resolved in validators #41

Open
@thclark

Description

@thclark

In the twine validation methods e.g. here the cls keyword is overloaded, in order to determine the serialisation direction and correctly cast inbound classes to objects.

However, this may not be the best design, as a cls keyword argument is also accepted by the lower level json decoders in load_json and essentially gets popped from the kwargs. here.

Perhaps it's as simple as renaming this cls argument e.g. to klass, but more likely we want to provide a decoder rather than a map.

Trick is: This decoder needs to be called where load_json receives a source object too.

Metadata

Metadata

Labels

bugUnintended behaviour in any area of the app

Type

No type

Projects

Status

Priority 1 (Low)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions