Skip to content

Commit a61f4fa

Browse files
committed
docs: fix typos and correct Gradle artifact IDs
#3211
1 parent 11e96ec commit a61f4fa

2 files changed

Lines changed: 58 additions & 4 deletions

File tree

CONTRIBUTING.adoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ The formatter does not cover all rules (such as order of imports) and an additio
9999
* Select "`IntelliJ IDEA`" -> "`Preferences`".
100100
* Select "`Editor`" -> "`Code Style`".
101101
* Select the wheel and "`Import Scheme`" -> "`IntelliJ IDEA code style XML`".
102-
* Select https://github.com/spring-projects/spring-boot/blob/master/idea/codeStyleConfig.xml[`idea/codeStyleConfig.xml`] from this repository.
103-
102+
* Select https://github.com/spring-projects/spring-boot/blob/main/.idea/codeStyles/codeStyleConfig.xml[`.idea/codeStyles/codeStyleConfig.xml`] from this repository.
104103
==== Importing into Eclipse
105104

106105
You can use Spring Boot project specific source formatting settings.

README.md

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ This project is sponsored by
4848
- [Error Handling for REST using @ControllerAdvice](#error-handling-for-rest-using-controlleradvice)
4949
- [Adding API Information and Security documentation](#adding-api-information-and-security-documentation)
5050
- [spring-webflux support with Annotated Controllers](#spring-webflux-support-with-annotated-controllers)
51+
- [Using a separate management port (Spring Boot 4)](#using-a-separate-management-port-spring-boot-3)
52+
- [When Spring Security is enabled](#when-spring-security-is-enabled)
5153
- [Acknowledgements](#acknowledgements)
5254
- [Contributors](#contributors)
5355
- [Additional Support](#additional-support)
@@ -221,7 +223,7 @@ Maven
221223
Gradle
222224

223225
```groovy
224-
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:latest'
226+
implementation 'org.springdoc:springdoc-openapi-starter-webflux-ui:latest'
225227
```
226228

227229
* This step is optional: For custom path of the swagger documentation in HTML format, add
@@ -245,6 +247,59 @@ Snapshots:
245247
* [https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/org/springdoc/](https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/org/springdoc/)
246248
.
247249

250+
## Using a separate management port (Spring Boot 4)
251+
252+
Some Spring Boot apps run **Actuator** on a separate management port. In that case:
253+
254+
- **Application port** (e.g., `8080`) serves your app and springdoc endpoints:
255+
- `http://localhost:8080/v3/api-docs`
256+
- `http://localhost:8080/swagger-ui/index.html`
257+
258+
- **Management port** (e.g., `9090`) serves Actuator:
259+
- `http://localhost:9090/actuator`
260+
- `http://localhost:9090/actuator/health`
261+
262+
Minimal `application.yml`:
263+
264+
```yaml
265+
server:
266+
port: 8080
267+
268+
management:
269+
server:
270+
port: 9090
271+
endpoints:
272+
web:
273+
exposure:
274+
include: health,info
275+
276+
# springdoc is enabled by default with the starter;
277+
# endpoints remain on the application port.
278+
# (OpenAPI JSON = /v3/api-docs, Swagger UI = /swagger-ui/index.html)
279+
```
280+
281+
### When Spring Security is enabled
282+
283+
With Spring Boot 3, `/v3/api-docs` and Swagger UI are served on the **application port**, while Actuator runs on the **management port**.
284+
If Spring Security is enabled, explicitly permit the docs paths on the **application port**:
285+
286+
```java
287+
@Bean
288+
SecurityFilterChain api(HttpSecurity http) throws Exception {
289+
http
290+
.authorizeHttpRequests(auth -> auth
291+
.requestMatchers(
292+
"/v3/api-docs/**",
293+
"/v3/api-docs.yaml",
294+
"/swagger-ui/**",
295+
"/swagger-ui.html"
296+
).permitAll()
297+
.anyRequest().authenticated()
298+
);
299+
return http.build();
300+
}
301+
```
302+
248303
# Acknowledgements
249304

250305
## Contributors
@@ -256,7 +311,7 @@ its [contributors](https://github.com/springdoc/springdoc-openapi/graphs/contrib
256311
<img src="https://contrib.rocks/image?repo=springdoc/springdoc-openapi" width="50%"/>
257312
</a>
258313

259-
Thanks you all for your support!
314+
Thank you all for your support!
260315

261316
## Additional Support
262317

0 commit comments

Comments
 (0)