Open Closed

Generation of Service Proxies for Angular not handling DateOnly properties correctly #5965


User avatar
0
dmannion created

After running abp generate-proxy -t ng, DTO properties that have a data type of DateOnly become "any" data type in the resulting TypeScript interfaces. In addition, it creates a system/models.ts as this:

export interface any extends any {
  minValue: any;
  maxValue: any;
  year: number;
  month: number;
  day: number;
  dayOfWeek: any;
  dayOfYear: number;
  dayNumber: number;
}

This results in the following error when trying to run the angular app:

Error: src/app/proxy/system/models.ts:2:18 - error TS2310: Type 'any' recursively references itself as a base type.

2 export interface any extends any {
~~~

Error: src/app/proxy/system/models.ts:2:18 - error TS2427: Interface name cannot be 'any'.

2 export interface any extends any {

DateOnly properties should be treated as strings in TypeScript since the .NET JSON Serializer natively supports writing DateOnly to/from string in the "yyyy-mm-dd" format.

  • ABP CLI version: v7.3.3 and v7.4.4

  • ABP Framework version: v7.3.2

  • UI Type: Angular

  • Database System: EF Core (SQL Server,

  • Tiered (for MVC) or Auth Server Separated (for Angular): yes

  • Exception message and full stack trace:

  • Steps to reproduce the issue:


3 Answer(s)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on April 11, 2025, 10:10