swagger

How to use RestSharp with Ambari Swagger

隐身守侯 提交于 2021-02-11 12:22:49
问题 How do I connect to Ambari's Swagger interface with a RestSharp client ? This code works and returns expected json: HttpClientHandler handler = new HttpClientHandler { Credentials = new System.Net.NetworkCredential("xxx", "yyyyy") }; using (var httpClient = new HttpClient(handler)) { var activationUrl = "https://aaaa.azurehdinsight.net"; var uri = new Uri(activationUrl + "/api/v1/users"); var response = await httpClient.GetAsync(uri); Assert.IsTrue(response.IsSuccessStatusCode); var result =

Aspnet core 2.2 default route changed to “~/index.html” after installing Swashbuckle.AspNetCore package

ぃ、小莉子 提交于 2021-02-11 09:39:39
问题 After installing the Swashbuckle.AspNetCore in my Asp.net Core (MVC) application the default route is override with "index.html" page. Where ever I used "~/" now is redirecting my application to "~/index.html" instead of default MVC route. How i can fix this? 回答1: I had encountered this issue after setting the route prefix of swagger to root i.e. app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "LMW Valuer API V1"); c.RoutePrefix = string.Empty; }); Even after removing

.NET Core Web Api Azure AD and Swagger not authenticating

大憨熊 提交于 2021-02-11 06:21:15
问题 I am trying to set up a .NET Core Web API with Azure AD authentication and Swagger but it gives an error when trying to authenticate. I am following this guide: http://www.sharepointconfig.com/2018/08/configure-swagger-to-authenticate-against-azure-ad/ ConfigureServices contains this code: services.AddSwaggerGen(c => { c.AddSecurityDefinition("oauth2", //Name the security scheme new OpenApiSecurityScheme { Type = SecuritySchemeType.OAuth2, Flows = new OpenApiOAuthFlows() { Implicit = new

How to add Jackson annotations to specific fields on swagger generated model classes for Spring

余生颓废 提交于 2021-02-11 00:04:11
问题 Folks, With swagger 2.0 does anyone know if it's possible to add Jackson annotations to specific fields on swagger generated model classes when using swagger codegen with 'spring' as the 'language' <language>spring</language> ? I want to use Jackson JSON Views & would like to add the view annotations to provide different views of the generated models when I return them from the various REST endpoints. However, I could not find any documentation if any on this on swagger. I see this slightly

How to add Jackson annotations to specific fields on swagger generated model classes for Spring

耗尽温柔 提交于 2021-02-10 23:58:11
问题 Folks, With swagger 2.0 does anyone know if it's possible to add Jackson annotations to specific fields on swagger generated model classes when using swagger codegen with 'spring' as the 'language' <language>spring</language> ? I want to use Jackson JSON Views & would like to add the view annotations to provide different views of the generated models when I return them from the various REST endpoints. However, I could not find any documentation if any on this on swagger. I see this slightly

Swagger Multiple Examples Not Showing

社会主义新天地 提交于 2021-02-10 05:13:46
问题 When I add examples into my swagger doc and test it on the swagger editor, then it never shows anywhere. Could someone give me an example of where multiple examples are actually showing anywhere? Here is an example of how multiple examples are added: it is from: https://swagger.io/docs/specification/adding-examples/ Here is an example of yaml that does not display any examples on the online swagger editor: openapi: 3.0.0 info: title: Some API version: 1.0.0 paths: /logon: get: summary: Login

Swagger Multiple Examples Not Showing

我与影子孤独终老i 提交于 2021-02-10 05:13:33
问题 When I add examples into my swagger doc and test it on the swagger editor, then it never shows anywhere. Could someone give me an example of where multiple examples are actually showing anywhere? Here is an example of how multiple examples are added: it is from: https://swagger.io/docs/specification/adding-examples/ Here is an example of yaml that does not display any examples on the online swagger editor: openapi: 3.0.0 info: title: Some API version: 1.0.0 paths: /logon: get: summary: Login

.NET Core 2.1 Swashbuckle - group controllers by area

拜拜、爱过 提交于 2021-02-09 20:32:28
问题 My situation is rather simple. I have a very large .NET Core 2.1 MVC/WebApi divided into several Areas, representing different modules of my system. I use Swagger (SwashBuckle) and it works very well. My routing are like {area}/{controller}/{action} . In Swagger UI, every action is grouped into the controllers (standard behaviour). My list of controllers and operations is becoming very very large and hard to grasp. Because of that, i would love if Swagger could divide my controllers into the

.NET Core 2.1 Swashbuckle - group controllers by area

自作多情 提交于 2021-02-09 20:30:54
问题 My situation is rather simple. I have a very large .NET Core 2.1 MVC/WebApi divided into several Areas, representing different modules of my system. I use Swagger (SwashBuckle) and it works very well. My routing are like {area}/{controller}/{action} . In Swagger UI, every action is grouped into the controllers (standard behaviour). My list of controllers and operations is becoming very very large and hard to grasp. Because of that, i would love if Swagger could divide my controllers into the

.NET Core 2.1 Swashbuckle - group controllers by area

不问归期 提交于 2021-02-09 20:30:12
问题 My situation is rather simple. I have a very large .NET Core 2.1 MVC/WebApi divided into several Areas, representing different modules of my system. I use Swagger (SwashBuckle) and it works very well. My routing are like {area}/{controller}/{action} . In Swagger UI, every action is grouped into the controllers (standard behaviour). My list of controllers and operations is becoming very very large and hard to grasp. Because of that, i would love if Swagger could divide my controllers into the