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.

NSwagStudio generating wrong method signature

See original GitHub issue

Hi guys,

I have these routes in my asp.net core:

/api/{subscriptionId}/sites 
public IActionResult List(string searchString);  
/api/sites 
public IActionResult ListAll(string subscriptionIdFilter = null, string searchString = null);

NSwagStudio is generates the first method just fine, but it is adding a phantom parameter called subscriptionId to the second one:

public async Task<ListViewModelOfSiteItem> ListAllAsync(string subscriptionId, string subscriptionIdFilter = null, string searchString = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))

This method is calling the first’s method endpoint, nswagstudio is somehow mixing them two. Or maybe I’m doing something wrong…?

Any thoughts?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
RicoSutercommented, Jul 12, 2017

Yes this is the problem… For now remove the route on the controller and specify all routes manually on the action - or dont use absolute routes on the actions when a ctrl route is set

0reactions
andrecarluccicommented, Jul 12, 2017

Yeap, sounds good.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NSwag Studio C# generated client code does not have any ...
I am trying to generate some client code from a swagger.json file and the methods created by NSwag do not have any return...
Read more >
Get started with NSwag and ASP.NET Core
Learn how to use NSwag to generate documentation and help pages for an ASP.NET Core web API.
Read more >
Using OpenApiReference To Generate Open API Client ...
I this post I show how you can customise the code generated by the OpenApiReference tooling from Visual Studio's Connected Services using ...
Read more >
Generate TypeScript and C# clients with NSwag based on ...
Learn how to generate TypeScript and C# API clients with NSwag to reduce your workload when building a project.
Read more >
Auto generated WebAPI client library with NSwag
How to configure dotnet core solutions to automatically generate client packages for WebAPI projects.
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