Minor feature toggle implemented in kotlin with AOP
The first idea was to fetch the User-Agente header and use a toggle based on the version:
@GetMapping("/cool")
@VersionToggle("#{api.minimumVersion}")
fun get(): ResponseEntity<String> {
return ResponseEntity.ok("Cool")
}
Given the application.properties:
api.minimumVersion=11.0.0
The current response for this code could be Cool
or Unsupported agent version.
.
Alex Rocha - about.me