-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor: update springdoc-openapi-plugin to 1.8.0 (#189)
add support for grouped apis in springdoc plugin Signed-off-by: Robin Maunz <[email protected]>
- Loading branch information
Showing
12 changed files
with
168 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
HELP.md | ||
.gradle | ||
build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
bin/ | ||
!**/src/main/**/bin/ | ||
!**/src/test/**/bin/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
### VS Code ### | ||
.vscode/ |
26 changes: 26 additions & 0 deletions
26
src/test/fixtures/springdocopenapi/grouped-api/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
plugins { | ||
id 'io.cloudflight.autoconfigure.springdoc-openapi-configure' | ||
} | ||
|
||
group = 'io.cloudflight.gradle' | ||
version = '1.0.0' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
openApiConfigure { | ||
groupedApiMappings = [ | ||
"/v3/api-docs/groupA": "groupA.yaml", | ||
"/v3/api-docs/groupB": "groupB.yaml" | ||
] | ||
} | ||
|
||
dependencies { | ||
implementation 'org.springframework.boot:spring-boot-starter-web:2.7.12' | ||
implementation 'org.springdoc:springdoc-openapi-ui:1.6.0' | ||
} | ||
|
||
tasks.named('test') { | ||
useJUnitPlatform() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rootProject.name = 'springdoc-openapi' |
53 changes: 53 additions & 0 deletions
53
...rouped-api/src/main/java/io/cloudflight/springdocopenapi/SpringDocOpenApiApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package io.cloudflight.springdocopenapi; | ||
|
||
import org.springdoc.core.GroupedOpenApi; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@SpringBootApplication | ||
public class SpringDocOpenApiApplication { | ||
public static void main(String[] args) { | ||
SpringApplication.run(SpringDocOpenApiApplication.class, args); | ||
} | ||
} | ||
|
||
@RestController | ||
class ControllerA { | ||
@GetMapping("/a") | ||
public String hello() { | ||
return "hello"; | ||
} | ||
} | ||
|
||
@RestController | ||
class ControllerB { | ||
@GetMapping("/b") | ||
public String hello() { | ||
return "hello"; | ||
} | ||
} | ||
|
||
@Configuration | ||
class SpringDocConfig { | ||
@Bean | ||
public GroupedOpenApi aApiGroup() { | ||
String[] paths = {"/a"}; | ||
return GroupedOpenApi.builder() | ||
.group("groupA") | ||
.pathsToMatch(paths) | ||
.build(); | ||
} | ||
|
||
@Bean | ||
public GroupedOpenApi bApiGroup() { | ||
String[] paths = {"/b"}; | ||
return GroupedOpenApi.builder() | ||
.group("groupB") | ||
.pathsToMatch(paths) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters