Update encode_value() and decode_value() to handle generic types properly
encode_value()
currently detects classes and inherits with generic types, and refuses to encode them. Update encode_value()
and decode_value()
to fully support them.
This is a remainder from #10146 (closed).
Edited by Henrik (Grubba) Grubbström