TypeScript client: DTO fields are not initialized
See original GitHub issueHi! After updating to current version toolchain (from v11.12.9.0) we’v faced with breaking change - now DTO peoperties are not initialized by default:
Old ( v11.12.9.0):
export class SelectRequestBaseOfInstallationFilter implements ISelectRequestBaseOfInstallationFilter {
filter: InstallationFilter = new InstallationFilter(); // INITED
page: Paginator = new Paginator(); //INITED
// skipped constructor & etc..
}
Current (v11.20.1.0):
export abstract class SelectRequestBaseOfInstallationFilter implements ISelectRequestBaseOfInstallationFilter {
filter: InstallationFilter; // NOT INITED
page: Paginator; // NOT INITED
// skipped constructor & etc..
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
TypeScript complain "has no initializer and is not definitely ...
Property 'someField' has no initializer and is not definitely assigned in the constructor. (property) MyClass.someField: boolean. TypeScript ...
Read more >Handling date fields in JSON with Typescript
When serializing objects to JSON, Date fields are serialized to strings in ISO 8601 format. But on the way back, when parsing, the...
Read more >How to dynamically assign properties to an object in ...
This seemingly harmless piece of code throws a TypeScript error on dynamically assigning name to the organization object.
Read more >TypeScript Add ServiceStack Reference
If your server has been updated and you want to update the client DTOs, simply right-click on the DTO file within VS.NET and...
Read more >Working with Json fields (Concepts) - Prisma
Working with Json fields. Use the Json Prisma field type to read, write, and perform basic filtering on JSON types in the underlying...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed in NSwag Build 1047
Shame on me!
I’v gave you wrong swagger definition!
Here is one, where the problem is reproduced (this is to the same API but generated with newer NSwag version). swagger_new.txt