Is there a way to NOT generate localAddress.*, remoteAddress.*, and sslInfo.*
See original GitHub issueI have a Spring Boot WebFlux 2.3.2.RELEASE
application that uses Gradle 6.5.1
. I’m using implementation("io.springfox:springfox-boot-starter:3.0.0")
in order to generate the Swagger documentation for the RESTful API, along with this configuration:
@Configuration
@Import(BeanValidatorPluginsConfiguration.class)
class SwaggerConfig {
@Bean
public Docket docket() {
return new Docket(DocumentationType.OAS_30)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage("tld.domain"))
.paths(PathSelectors.regex("/endpoint.*"))
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.contact(new Contact("Team", null, "identifier@domain.tld"))
.description("RESTful API Reference for Developers")
.title("RESTful API")
.version("1.0")
.build();
}
}
The problem is that Swagger is generating an enormous amount of parameters that aren’t used (first hand): localAddress.address.MCGlobal
, localAddress.address.MCLinkLocal
, localAddress.address.MCNodeLocal
, localAddress.address.MCOrgLocal
, localAddress.address.canonicalHostName
, remoteAddress.address.MCGlobal
…and so on.
Is there a way to filter those, minimize the amount, or just don’t generate them as part of the documentation (read: the final HTML). I don’t fully understand why Swagger is generating those query parameters. It looks like it generates everything pretty well, expect for that detail: the extra (useless for me) parameters.
I’m not using any other annotation(s) in the code, nor any other setting(s) in the
application.[properties|yml]
file.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Sounds like you need to add
ServerHttpRequest
to the ignorable typesdocket.ignoredParameterTypes(ServerHttpRequest.class)
should do the trickSeems like if you prefer (Im not sure what type
localAddress
is), but if you dont need those parameters, Im guessing its one of these scenarioslocalAddress
then you could annotate it with @ApiModeProperty(hidden=true) 1b. if you dont own it you could create an alternate type rule to substitute the type with another type that is more in like with the parameters you’re looking for.