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.

MultipleApiVersions is not called

See original GitHub issue

Hi, I want to force to include both methods in a Swagger document. The second method is simply skipped in MultipleApiVersions because both methods have the same route. Once i change a Route for any action, MultipleApiVersions is called for both.

    [MapToApiVersion("6.0")]
    [Route("items")]
   public  Task<Item> PostItemsAsync([FromBody] Item item)
    {
    }
    [MapToApiVersion("8.0")]
    [Route("items")]
    [HttpPost]
    public Task<ItemV8> PostItemAsyncV8([FromBody] ItemV8 item)
    {
    }

Thanks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
commonsensesoftwarecommented, Jun 13, 2017

In addition to the API versioning and Swashbuckle packages, you also need the ASP.NET Web API Versioned API Explorer package. Then you need to call configuration.AddVersionedApiExplorer() in your application setup. Finally, you need to use the API explorer to call MultipleApiVersions in the Swagger configuration. A complete example of what this might look like can be found here. Your application configuration may be slightly different.

0reactions
SashaBezugliycommented, Jun 14, 2017

@commonsensesoftware thank you very much! That was exactly what i needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MultipleApiVersions is not called · Issue #1057
Hi, I want to force to include both methods in a Swagger document. The second method is simply skipped in MultipleApiVersions because both ......
Read more >
c# - Swagger not working correctly with multiple versions of ...
I'm trying to setup API versioning for a ASP.NET WebApi project, along with Swagger. The API versioning works fine, calling different versions ...
Read more >
Supporting Multiple API Versions in Android
VERSION.SDK_INT is not called on Cupcake devices. Java knows that it is not available on that device when it loads the class. This...
Read more >
C# – Swagger not working correctly with multiple versions ...
The API versioning works fine, calling different versions returns the correct results (see below). On the contrary, Swagger fails to serve both versions....
Read more >
Put request to Azure API does not update parameters on linked ...
Hello everyone I am trying to update paramerers for linked service below: { name": "asql", "type": "Microsoft.Synapse/workspaces/linkedservices" ...
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