Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generation of class does not generate a constructor with mappings #1826

Closed
ghost opened this issue Dec 13, 2018 · 4 comments
Closed

Generation of class does not generate a constructor with mappings #1826

ghost opened this issue Dec 13, 2018 · 4 comments

Comments

@ghost
Copy link

ghost commented Dec 13, 2018

Hi,
Got the latest Studio (v12.0.6) and generated my service files and encountered a massive issue. We rely on the constructor of many of our classes to build the classes. But since v12.0.6, the constructor does not have the mappings. Is that an issue or have you changed the way it works?

Previous

constructor(data?: className) {
        super(data);
}
// Super
constructor(data?: ICommand) {
    if (data) {
        for (var property in data) {
            if (data.hasOwnProperty(property))
                (<any>this)[property] = (<any>data)[property];
        }
    }
}

Now

constructor(data?: className) {
        super(data);
}
// Super
constructor(data?: ICommand) {}

Thanks

@RicoSuter
Copy link
Owner

Probably a regression of this PR: RicoSuter/NJsonSchema#831

Is it correct that this code is missing in the root dto?

@RicoSuter
Copy link
Owner

Ah i need to remove the properties.size check

@RicoSuter
Copy link
Owner

NSwag v12.0.7

@ghost
Copy link
Author

ghost commented Dec 13, 2018

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant