diff --git a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v1_validator_register_validator.json b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v1_validator_register_validator.json index 802ad1eb56f..ad4d525dc2a 100644 --- a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v1_validator_register_validator.json +++ b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v1_validator_register_validator.json @@ -37,6 +37,16 @@ } } }, + "415" : { + "description" : "Unsupported media type", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/HttpErrorResponse" + } + } + } + }, "503" : { "description" : "Service unavailable", "content" : { diff --git a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/validator/PostRegisterValidator.java b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/validator/PostRegisterValidator.java index c4b21bdb865..fe3e108be7b 100644 --- a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/validator/PostRegisterValidator.java +++ b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/validator/PostRegisterValidator.java @@ -54,6 +54,7 @@ public PostRegisterValidator(final ValidatorDataProvider validatorDataProvider) SIGNED_VALIDATOR_REGISTRATIONS_SCHEMA.getJsonTypeDefinition(), SIGNED_VALIDATOR_REGISTRATIONS_SCHEMA::sszDeserialize) .response(SC_OK, "Registration information has been received.") + .withUnsupportedMediaTypeResponse() .withBadRequestResponse( Optional.of( "The request could not be processed, check the response for more information."))