I have N versions of a protocol to support. Each version of the protocol has the same datatypes, each with a different "Schema" defined, so there are slight difference between datatypes between versions.
I have a single endpoint where I check which version is the caller using and receive such datatypes. I want to "decode" such datatypes with the correct schema version and apply some function mapping / transformation so that from that point forward I have a single datatype, maybe one which can represent the same datatype for every version, but still want to fail if someone send me a datatype in the form of a version which is different from the version using when calling my endpoint.