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.

error opening ui

See original GitHub issue

Hi, I just added the rc1 version to an aurelia app, configured startup and tried to open the ui and I see this

untitled

I suppose that the error is: An unhandled exception occurred while processing the request.

<div class="titleerror">NotSupportedException: Unbounded HTTP verbs for path 'api/Attivita/GetLatest/{last}'. Are you missing an HttpMethodAttribute?</div

but this is the declaration of the action inside the controller

    [Route("[action]/{last:int}")]
    [HttpGet("{last}")]
    public IEnumerable<UltimaAttivitaVm> GetLatest(int last)
    {

am I missing something?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:18 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
bsell93commented, Jul 22, 2017

Just figured out how to do this… By setting DocInclusionPredicate in my setup I was able to ignore methods that don’t have a specified HttpMethod.

The source code that helped me come to this conclusion: https://github.com/domaindrivendev/Swashbuckle.AspNetCore/blob/master/src/Swashbuckle.AspNetCore.SwaggerGen/Generator/SwaggerGenerator.cs#L84

My fix:

services.AddSwaggerGen(c =>
{
    c.DocInclusionPredicate((docName, apiDesc) =>
    {
        if (apiDesc.HttpMethod == null) return false;
        return true;
    });
});

Also important to note that I am using dotnet core sdk: 1.0.0-rc4-004771, swagger aspnetcore v1.

By doing this it also removes the need to set methods to protected assuming those methods don’t have httpMethod attributes on them.

5reactions
freshdev1commented, Jul 25, 2016

So I had the same problem today and the resolution was simple… I had the following two GET attributes on the Controller Action:

[HttpGet]
[HttpGet("id/{id?}")]

While the first one is understandable to WebApi. It is not understandable to Swagger for some reason. I fixed the issue after changing it to this:

[HttpGet("")]
[HttpGet("id/{id?}")]

Hope this helps someone.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What should I do if I keep getting a UI Error while trying to ...
If you are still getting UI errors: Open the game and go to the settings menu [Esc]. Go to each subsection, Social, Gameplay,...
Read more >
User Interface (UI) Errors
UI ' error message? Right click on the PC*MILER 30 icon on your desktop. Select Open file location. Delete the file "user.
Read more >
UI automation action fails with "Failed to get UI element" or ...
This article helps you resolve error messages that you may receive when a UI automation action fails in Microsoft Power Automate.
Read more >
Error on Opening UI Explorer - Help
Hi All, I am facing a problem with UI Explorer, every time I click the UI Explorer, it will pop up a WPF...
Read more >
Shotgun Web UI: Error opening key SOFTWARE
Hi support,. I'm testing default config now, with all options left with default values. My PC doesn't have 3DsMax. Everytime when I launch...
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