Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: DiscriminatorDescriptor interface now accepts number, too #582

Closed
wants to merge 3 commits into from

Commits on Feb 12, 2021

  1. DiscriminatorDescriptor should accept number, too

    When using an enum as `name` it works fine by adding `//@ts-ignore` but the interface didnt allow that. 
    
    ```
    @ValidateNested()
      @type(() => MyDto, {
        discriminator: {
          property: 'type',
          subTypes: [
            {value: MySubDto1, name: MyEnum.Something},
            {value: MySubDto2, name: MyEnum.SomethingOther},
          ],
        },
        keepDiscriminatorProperty: true,
      })
      cupData: MySubDto1 | MySubDto2;
    ```
    MickL committed Feb 12, 2021
    Configuration menu
    Copy the full SHA
    a908c3d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    701ebd1 View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2021

  1. Configuration menu
    Copy the full SHA
    0ffc97a View commit details
    Browse the repository at this point in the history