Skip to content

Missing API dropdownlist #1

@secret-agent-B

Description

@secret-agent-B

Any idea why I am not getting the dropdownlist in swagger UI?

            var consulUri = this.Configuration["ConsulConfiguration:ConsulUri"];

            app
                .UseMvc()
                .UseCors(options => options.WithOrigins("http://localhost:8080")
                    .AllowAnyMethod()
                    .AllowAnyHeader()
                    .AllowCredentials())
                .UseOcelotSwagger(async x =>
                    {
                        var consulClient = new ConsulClient(c => c.Address = new Uri(consulUri));
                        var services = await consulClient.Agent.Services();

                        foreach (var (key, value) in services.Response)
                        {
                            x.SwaggerEndPoints.Add(new SwaggerEndPoint
                            {
                                Name = key,
                                Url = $"/{value.Service}/swagger/v1/swagger.json",
                            });
                        }
                    })
                .UseOcelot()
                .Wait();

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions