Open Closed

ABP 10 Angular proxy: required C# fields generated as optional in TypeScript #10400


User avatar
0
devpayoff created

Hi, we updated from ABP 8 to ABP 10. When regenerating proxies, we noticed that many fields that were required in C# are now generated as optional (nullable) in TypeScript.

Example:

public class AlertDto { public required string NodeName { get; set; } public required Guid Id { get; set; } public TriggeringEvent TriggeringEvent { get; set; } public List<string> Users { get; set; } = []; public bool ShowOneTime { get; set; } public required string Content { get; set; } public List<string> Tenants { get; set; } = []; public AlertsType AlertType { get; set; } public bool ReadConfirm { get; set; } public DateTime FromDate { get; set; } public List<string> Roles { get; set; } = []; public List<string> TriggeredApps { get; set; } = []; public DateTime ToDate { get; set; } public Frequency? Frequency { get; set; } public int? FrequencyInterval { get; set; } public FrequencyTimeUnit? FrequencyTimeUnit { get; set; } }

or

public class TrainingPathDetailDto { public Guid Id { get; set; } public string Name { get; set; } = string.Empty; public string? Description { get; set; } public TriggerType TriggerType { get; set; } public bool IsActive { get; set; } public int? TrainingPathCompletionDaysLimit { get; set; } public DateTime CreatedAt { get; set; } public Guid? RoleId { get; set; } public Guid? DutyId { get; set; } public List&lt;TrainingPathItemDetailDto> CourseItems { get; set; } = new(); }

Is this behavior intentional? How can we fix it? Do we need to add [Required] to every field that should be required?


No answer yet!
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.2.0-preview. Updated on February 05, 2026, 13:24
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.