question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript client: DTO fields are not initialized

See original GitHub issue

Hi! 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:closed
  • Created 5 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
ilicommented, Feb 13, 2019
0reactions
ilicommented, Nov 6, 2018

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found