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

NSwag produces invalid typescript #1683

Closed
Kordonme opened this issue Oct 24, 2018 · 3 comments
Closed

NSwag produces invalid typescript #1683

Kordonme opened this issue Oct 24, 2018 · 3 comments

Comments

@Kordonme
Copy link

In my process methods NSwag produces an else statement, but the variable names doesn't seem to follow the correct naming:

} else {
    return response.text().then((_responseText) => {
    let resultdefault: any = null;
    let resultDatadefault = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
    result = resultData ? BadRequestObjectResult.fromJS(resultData) : new BadRequestObjectResult();
    return throwException("A server error occurred.", status, _responseText, _headers, resultdefault);
    });
}

Cannot find name 'result' and Cannot find name 'resultData'. The variables are obviously named resultdefault and resultDatadefault.

@RicoSuter
Copy link
Owner

Can you provide a sample swagger spec?

@Kordonme
Copy link
Author

I will provide one in a few hours.

@Kordonme
Copy link
Author

Here's a sample swagger specification and it produces this typescript client.

Using this command:

nswag swagger2tsclient /input:Mock.json /output:Client.ts

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

No branches or pull requests

2 participants