Request parameter validation

Report a typo

Observe the REST Controller below:

Java
@RestController
{1}
public class BitcoinController {

    @GetMapping("/bitcoins")
    ResponseEntity<String> validateBitcoin(
            @RequestParam("rate") {2} int rate) {
        return ResponseEntity.ok("Bitcoin rate is valid.");
    }
}
Kotlin
@RestController
{1}
class BitcoinController {

    @GetMapping("/bitcoins")
    fun validateBitcoin(@RequestParam("rate") {2} rate: Int): ResponseEntity<String> {
        return ResponseEntity.ok("Bitcoin rate is valid.")
    }
}

Choose missing annotations of the BitcoinController class if we want to validate that rate request parameter of the method validateBitcoin is higher or equal to 1000:

Select one option from the list
___

Create a free account to access the full topic