Comments on: Microservices API Documentation with Springdoc OpenAPI https://piotrminkowski.com/2020/02/20/microservices-api-documentation-with-springdoc-openapi/ Java, Spring, Kotlin, microservices, Kubernetes, containers Wed, 13 Sep 2023 13:47:15 +0000 hourly 1 https://wordpress.org/?v=6.9.1 By: piotr.minkowski https://piotrminkowski.com/2020/02/20/microservices-api-documentation-with-springdoc-openapi/#comment-2133 Wed, 13 Sep 2023 13:47:15 +0000 http://piotrminkowski.com/?p=7756#comment-2133 In reply to asali.

No, there were no many changes there. In most cases, just a new artifacts to include.

]]>
By: asali https://piotrminkowski.com/2020/02/20/microservices-api-documentation-with-springdoc-openapi/#comment-2124 Fri, 08 Sep 2023 00:07:14 +0000 http://piotrminkowski.com/?p=7756#comment-2124 Hi, thanks for the guide.
I am working with
springdoc-openapi v2.2.0
spring-cloud-starter-gateway with spring cloud version 2022.0.4
spring boot v3.1.2

I followed the guide but on Swagger UI still not able to load API definition for my other services.
Is there anything changed because of the newer version of springdoc-openapi?

]]>
By: piotr.minkowski https://piotrminkowski.com/2020/02/20/microservices-api-documentation-with-springdoc-openapi/#comment-1964 Wed, 03 May 2023 23:28:06 +0000 http://piotrminkowski.com/?p=7756#comment-1964 In reply to ilham.

Hello. As far as I know – no.

]]>
By: ilham https://piotrminkowski.com/2020/02/20/microservices-api-documentation-with-springdoc-openapi/#comment-1937 Thu, 13 Apr 2023 10:57:22 +0000 http://piotrminkowski.com/?p=7756#comment-1937 Hello, thanks for the information. Is it possible to get all definitions in one json?

]]>
By: Jitu https://piotrminkowski.com/2020/02/20/microservices-api-documentation-with-springdoc-openapi/#comment-1892 Wed, 01 Mar 2023 14:20:03 +0000 http://piotrminkowski.com/?p=7756#comment-1892 Thank you. But for api gateway , the groupingApi is not working.

]]>
By: piotr.minkowski https://piotrminkowski.com/2020/02/20/microservices-api-documentation-with-springdoc-openapi/#comment-1888 Wed, 01 Mar 2023 09:50:51 +0000 http://piotrminkowski.com/?p=7756#comment-1888 In reply to Jitu.

It should work with v3. I need to actualize the repo. For now, I’ve got it here: https://github.com/piomin/sample-api-versioning

]]>
By: Jitu https://piotrminkowski.com/2020/02/20/microservices-api-documentation-with-springdoc-openapi/#comment-1884 Tue, 28 Feb 2023 14:04:53 +0000 http://piotrminkowski.com/?p=7756#comment-1884 Any idea how it will work with springboot3 : GroupedOpenApi is not working?

]]>
By: piotr.minkowski https://piotrminkowski.com/2020/02/20/microservices-api-documentation-with-springdoc-openapi/#comment-1811 Thu, 19 Jan 2023 11:03:27 +0000 http://piotrminkowski.com/?p=7756#comment-1811 In reply to Spring User.

In my case I’m creating the bean:
“`
@Bean
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
http.authorizeExchange(exchanges -> exchanges.anyExchange().permitAll())
.httpBasic();
http.csrf().disable();
return http.build();
}
“`

Otherwise I need to provide auth data:
https://github.com/piomin/sample-spring-cloud-gateway/blob/master/src/test/java/pl/piomin/services/gateway/GatewaySecureRateLimiterTest.java

]]>
By: Spring User https://piotrminkowski.com/2020/02/20/microservices-api-documentation-with-springdoc-openapi/#comment-1795 Sun, 15 Jan 2023 14:05:19 +0000 http://piotrminkowski.com/?p=7756#comment-1795 Hi, thank you for this nice blog post. I used it in its entirety however, I only received 401 response status for the “http://localhost:8070/v3/api-docs/main” (“main” is my micro-service name). My project implemented Reactive spring security, which is case for the most of the spinning application. I was able to eliminate the unauthorised response and I came here to share the code snippets. I hope it helps some one wandering because of spring security placed inside gateway service.

1. For the gateway routes
## OPEN-API SERVICE
– id: openapi
uri: http://localhost:${server.port}
predicates:
– Path=/v3/api-docs/**
## MAIN SERVICE – My actual micro-service
– id: main-service
uri: http://localhost:8081
predicates:
– Path=/main/**
filters:
– RewritePath=/main/(?.*), /$\{path}, AddRequestHeader=Authorization

2. For the swagger-ui (Place the code below in gateway’s yaml/properties file)
springdoc:
swagger-ui:
disable-swagger-default-url: true
urls:
– url: /main/v3/api-docs
name: Main-service REST API docs

3. For the Web or WebFlux security
http.authorizeExchange()
.pathMatchers(
“/main/v3/api-docs”,
“/v3/api-docs/**”,
“/v3/api-docs”,
“/swagger-resources/**”,
“/swagger-resources”,
“/configuration/ui”,
“/configuration/security”,
“/swagger-ui.html”,
“/swagger-ui/**”,
“/webjars/**”,
“/webjars”
)
.permitAll() ]]> By: springlearner https://piotrminkowski.com/2020/02/20/microservices-api-documentation-with-springdoc-openapi/#comment-1634 Mon, 15 Aug 2022 05:13:46 +0000 http://piotrminkowski.com/?p=7756#comment-1634 When I hit any endpoint from Swagger UI, I get the below issue. Certainly something we need to add as a part of configuration

Failed to fetch.
Possible Reasons:

CORS
Network Failure
URL scheme must be “http” or “https” for CORS request.

]]>