Skip to content

Null value in select with @StringType() annotation results in yup type error #27

Description

@SubjectiveReality
          <select [(ngModel)]="model.provider" name="provider" #providerField="ngModel" class="field-control" />
            <option [ngValue]="null">Use parent value</option>
            <option *ngFor="let option of providers" [value]="option.key">{{option.key}}</option>
          </select>
export class TicketModel {
  @StringType()
  provider?: string | null; // not required
}

Selecting the valid option with null value when @StringType() annotation is applied to the model property results in yup error, as schema is not defined as .nullable() or .notRequired() by default.

This problem can occur in various annotation types when not required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions