Not sure why, but I can't seem to return a data class that implements the expected interface.
interface
interface AuthServiceResponse {
val statusCode: Int
val data: AuthServiceResponseData
val errors: List<AuthServiceResponseError>?
}
implementation
data class AuthServiceBasicResponse(override var statusCode: Int,
override var data: AuthServiceResponseData,
override var errors: List<AuthServiceResponseError>) : AuthServiceResponse
expecting the AuthServiceResponse interface
@PostMapping
fun loginUser(@RequestParam username: String,
@RequestParam password: String): Mono<AuthServiceResponse> {
return authenticationService.loginUser(username, password)
}
method that returns the AuthServiceBasicResponse class that implements the AuthServiceResponse interface
fun loginUser(username: String,
password: String): Mono<AuthServiceBasicResponse> {
...
}