swagger .net core API ambiguous HTTP method for Action Error

This can occur when a method is declared public in a controller, but without REST attributes. Changing the method to protected may address the issue. I have seen this kind of error before and usually the error message points to the culprit: EBisAPI.Controllers._class.HandleError I guess HandleError is a public method in your base class, right? … Read more

Keycloak integration in Swagger

Swagger-ui can integrate with keycloak using the implicit authentication mode. You can setup oauth2 on swagger-ui so that it will ask you to authenticate instead of giving swagger-ui the access token directly. 1st thing, your swagger need to reference a Security definition like: “securityDefinitions”: { “oauth2”: { “type”:”oauth2″, “authorizationUrl”:”http://172.17.0.2:8080/auth/realms/master/protocol/openid-connect/auth”, “flow”:”implicit”, “scopes”: { “openid”:”openid”, “profile”:”profile” } … Read more

How can I set a description and an example in Swagger with Swagger annotations?

I have similar issue with generating examples for body objects – annotation @Example and @ExampleProperty simply doesn’t work for no reason in swagger 1.5.x. (I use 1.5.16) My current solution is: use @ApiParam(example=”…”) for non-body objects, e.g.: public void post(@PathParam(“userId”) @ApiParam(value = “userId”, example = “4100003”) Integer userId) {} for body objects create new class … Read more

How do you turn off swagger-ui in production

Put your swagger configuration into separate configuration class and annotate it with @Profile annotation -> so that it will be scanned into Spring context only in certain profiles. Example: @Configuration @EnableSwagger2 @Profile(“dev”) public class SwaggerConfig { // your swagger configuration } You can than define profile your Spring Boot app is operating in via command … Read more

What is Swagger, Swashbuckle and Swashbuckle UI

Swagger is a notation/rules to write documentation. But why is it called a framework(Like angular/MVC)? It is probably called a “framework” because its’ purpose is to offer a systematic way of notating the interface of any RESTful service under the OpenAPI Specification. This is a big deal to developers because the spec is overseen by … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)