typestack / class-transformer

Decorator-based transformation, serialization, and deserialization between objects and classes.
MIT License
6.64k stars 486 forks source link

fix: allow subTypes.name to be a number in DiscriminatorDescriptor #1683

Closed nesro closed 2 months ago

nesro commented 4 months ago

Description

Fixes https://github.com/typestack/class-transformer/issues/737 as it is a small fix, but very useful and needed. It allows subTypes.name to be a number as well - useful when discriminating with a version property for example.

Checklist

I did not edit the documentation as it doesn't mention the string type so it being a number is fine.

Fixes

fixes #737

github-actions[bot] commented 1 month ago

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.