abp icon indicating copy to clipboard operation
abp copied to clipboard

Javascript proxy generation: all reference type and enum properties in a record are generated as nullable

Open hillin opened this issue 1 month ago • 0 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Description

All reference type properties and enum properties in a record type are generated as nullable.

Reproduction Steps

public enum TestEnum
{
    A,
    B,
}

public record TestDto(Guid GuidValue, string StringValue, int IntValue, TestEnum EnumValue);

abp generate-proxy -t ng --entry-point .

export interface TestDto {
  guidValue?: string;
  stringValue?: string;
  intValue: number;
  enumValue?: TestEnum;
}

Expected behavior

Since these properties guidValue, stringValue and enumValue are not defined as nullable in the record, they should not be generated as nullable in the typescript proxy code.

If records are not supposed to be used as DTOs, it should be documented.

Actual behavior

The abovementioned properties are generated as nullable.

Regression?

No response

Known Workarounds

No response

Version

9.3.6

User Interface

Angular

Database Provider

None/Others

Tiered or separate authentication server

None (Default)

Operation System

Windows (Default)

Other information

The enum properties part is related to https://github.com/abpframework/abp/issues/22132

hillin avatar Dec 01 '25 09:12 hillin