Open Closed

Actions require a unique method/path combination for Swagger/OpenAPI 3.0. Use ConflictingActionsResolver as a workaround #1720


User avatar
0
jon.hallam@managed-desktop.com created
  • ABP Framework version: v4.4
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): / no
  • Exception message and stack trace:
 ERR] An unhandled exception has occurred while executing the request.
Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorException: Conflicting method/path combination "GET api/app/nordigens" for actions - Life.Controllers.Nordigens.NordigenController.GetListAsync (Life.HttpApi),Life.Controllers.Nordigens.NordigenController.BanksAsync (Life.HttpApi). Actions require a unique method/path combination for Swagger/OpenAPI 3.0. Use ConflictingActionsResolver as a workaround
   at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GenerateOperations(IEnumerable`1 apiDescriptions, SchemaRepository schemaRepository)
   at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GeneratePaths(IEnumerable`1 apiDescriptions, SchemaRepository schemaRepository)
   at Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenerator.GetSwagger(String documentName, String host, String basePath)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession ...
  

Ive followed the same process to add a api endpoint from before and its not working. can you point me at the document to help me with this please?

  • Steps to reproduce the issue:"

8 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Conflicting method/path combination "GET api/app/nordigens" for actions - Life.Controllers.Nordigens.NordigenController.GetListAsync (Life.HttpApi),Life.Controllers.Nordigens.NordigenController.BanksAsync (Life.HttpApi). Actions require a unique method/path combination for Swagger/OpenAPI 3.0. Use ConflictingActionsResolver as a workaround

    hi

    Can you share the code of NordigenController

  • User Avatar
    0
    jon.hallam@managed-desktop.com created

    whats your github ill share the project

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    https://github.com/maliming

  • User Avatar
    0
    jon.hallam@managed-desktop.com created

    added you

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Can you try this?

    [HttpGet]
    [Route("banks")]
    public virtual Task<string> BanksAsync()
    {
        return _nordigensAppService.BanksAsync();
    }
    
  • User Avatar
    0
    jon.hallam@managed-desktop.com created

    in which file should this be?

  • User Avatar
    0
    jon.hallam@managed-desktop.com created

    Found it, all sorted now. thanks

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    https://github.com/jhallam3/Life/blob/c96807bfefd4d112be5589b454d595cf46b6ee58/aspnet-core/src/Life.HttpApi/Controllers/Nordigens/NordigenController.cs#L31

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38