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 endpoint address

See original GitHub issue

Hi @RSuter

I started a new project to try to reproduce the parameter problem (#842) and got another one:

namespace nswagtest.Controllers {
    [Produces("application/json")]
    [Route("/api/{subscriptionId}/[controller]")]
    public class SitesController : Controller {

        [HttpGet]
        [ProducesResponseType(typeof(Array), StatusCodes.Status200OK)]
        public IActionResult List(string searchString) {
            return Ok(new[] {"with", "parameter"});
        }

        [HttpGet("/api/sites")]
        [ProducesResponseType(typeof(Array), StatusCodes.Status200OK)]
        public IActionResult ListAll(string searchString) {
            return Ok(new[] {"list", "all"});
        }
    }
}

SwaggerUI generates the /api/sites endpoint correctly, but NSwagStudio creates it like: /api/{subscriptionId}/Sites/api/sites

Issue Analytics

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

github_iconTop GitHub Comments

0reactions
andrecarluccicommented, Jul 12, 2017

Wow! That was fast! Thank you so much!!! It worked 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Specifying API Endpoint at runtime when using NSwagStudio
EDIT: In NSwagStudio I've tried to create a "configuration class" but couldn't easily see how to use it or apply it to this...
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 >
How to make Web API endpoint's base URL, configurable in ...
The problem I'm going to address in this article though, is: “How to get NSwag clients to read their Web API endpoint from...
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 >
Automatically generating C# API clients on build with NSwag
The easiest way to create a nswag.json config file is by using NSwagStudio which you can install on Windows using an MSI you...
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