I am new to Swagger.io and so also to Spring fox. The problem I am having is, that for some Reason one Object is not correctly referenced to its model.
The error is because it ends up like this in the JSON:
"schema": {
"$ref": "#/definitions/Error-ModelName{namespace='online.staffmanager.backend.auth.model.dto', name='UserChangeSet'}"
}
if I change it to:
"schema": {
"$ref": "#/definitions/UserChangeSet"
}
it does work. And I have no Idea why the anotations are mapping it like this.
My Annotations:
@Operation(
tags = "auth",
summary = "Create a new User Account",
responses = {
@ApiResponse(
responseCode = "200",
content = @Content(schema = @Schema(implementation = TokenInfo.class))),
@ApiResponse(
responseCode = "201",
content = @Content(schema = @Schema(implementation = UserChangeSet.class)))
}
)
SpringFoxConfig:
@Configuration
@EnableSwagger2
@EnableWebMvc
public class SpringFoxConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build();
}
}
Note: I am using Springfox 3.0.0. Thanks in advance!
