An open API service indexing awesome lists of open source software.

https://github.com/bliblidotcom/swagger2-plugin

Swagger Plugin for Spring Boot 2 WebFlux
https://github.com/bliblidotcom/swagger2-plugin

java open-api spring-boot spring-boot2 spring-webflux swagger

Last synced: 9 months ago
JSON representation

Swagger Plugin for Spring Boot 2 WebFlux

Awesome Lists containing this project

README

          

# Swagger Plugin for Spring Boot 2 WebFlux

This is plugin integrate swagger on Spring Boot 2 WebFlux project. This project is not working on Spring Web MVC.

## How to use it

Add dependency

```xml

com.blibli.oss
swagger-plugin2
...

```

And this plugin will automatically scan all your controller

You can access your swagger ui on `http://localhost:8080/swagger-ui.html`

## Global Parameter

Sometimes you want to add global parameter (configure once, and use everywhere). You can use this by register your custom `io.swagger.v3.oas.models.parameters.Parameter` bean. Example :

```java
@Configuration
public class YourConfiguration {

@Bean
public Parameter queryChannelId() {
return new QueryParameter()
.name("channelId")
.example("channelId")
.required(true);
}

}
```

After that, you can use your parameter using `@io.swagger.v3.oas.annotations.Parameter(name="uniqueName", ref="beanName")` annotation, example :

```java
@RestController
public class ExampleController {

@GetMapping("/")
@Parameter(name = "queryChannelId", ref = "queryChannelId")
public Mono home() {
return Mono.just("Home");
}

}
```

## Ignore Parameter