Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing API dropdownlist #1

Open
secret-agent-B opened this issue Jul 7, 2019 · 1 comment
Open

Missing API dropdownlist #1

secret-agent-B opened this issue Jul 7, 2019 · 1 comment

Comments

@secret-agent-B
Copy link

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

@Rwing
Copy link
Owner

Rwing commented Jul 8, 2019

Thank you for your interest in this project. This code looks good, could you provide more information?

DotNetConcept pushed a commit to DotNetConcept/OcelotSwagger that referenced this issue Jul 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants