From d5e831bd54b39968f3ff23ab48904a46c4a20f82 Mon Sep 17 00:00:00 2001 From: Priamo Germosen <6233424+pgermosen@users.noreply.github.com> Date: Sat, 14 Nov 2026 17:22:54 -0400 Subject: [PATCH] fix(emr-serverless): answer UpdateApplication with the updated application (#8369) UpdateApplication answered {applicationId, arn, name}, while the model's UpdateApplicationResponse is {application}, required: "Information about the updated application". A client reading it found no application: a KeyError in boto3, a null in the Java SDK. It now answers with the application as GetApplication reports it, without the clientToken storage keeps for CreateApplication's retries. --- docs/services/emr-serverless.md | 2 ++ .../EmrServerlessController.java | 5 +---- .../model/UpdateApplicationResponse.java | 22 +++++++++++-------- .../EmrServerlessIntegrationTest.java | 10 +++++++-- 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/docs/services/emr-serverless.md b/docs/services/emr-serverless.md index 611d6ebe27..28a0c7aa24 100644 --- a/docs/services/emr-serverless.md +++ b/docs/services/emr-serverless.md @@ -58,6 +58,8 @@ another. `interactiveConfiguration`, `identityCenterConfiguration` and `jobLevelCostAllocationConfiguration` among them, and `GetApplication` returns each as it was written. +`UpdateApplication` answers with the updated application, as `GetApplication` reports it. + `UpdateApplication` changes any setting of a `CREATED` or `STOPPED` application, and of a `STARTED` one its `maximumCapacity` and its custom images, `imageConfiguration` and `workerTypeSpecifications`, as the user guide's "Updating Running Applications" describes. For every other setting the API reference's "An application has to be in diff --git a/src/main/java/io/floci/aws/services/emrserverless/EmrServerlessController.java b/src/main/java/io/floci/aws/services/emrserverless/EmrServerlessController.java index 1c39368544..702e17227a 100644 --- a/src/main/java/io/floci/aws/services/emrserverless/EmrServerlessController.java +++ b/src/main/java/io/floci/aws/services/emrserverless/EmrServerlessController.java @@ -95,11 +95,8 @@ public class EmrServerlessController { @Path("/{applicationId}") public UpdateApplicationResponse updateApplication(@PathParam("applicationId") String applicationId, UpdateApplicationRequest request) { - Application app = service.updateApplication(applicationId, request); UpdateApplicationResponse response = new UpdateApplicationResponse(); - response.setApplicationId(app.getApplicationId()); - response.setArn(app.getArn()); - response.setName(app.getName()); + response.setApplication(service.updateApplication(applicationId, request)); return response; } diff --git a/src/main/java/io/floci/aws/services/emrserverless/model/UpdateApplicationResponse.java b/src/main/java/io/floci/aws/services/emrserverless/model/UpdateApplicationResponse.java index 3eaabac20e..856d095b88 100644 --- a/src/main/java/io/floci/aws/services/emrserverless/model/UpdateApplicationResponse.java +++ b/src/main/java/io/floci/aws/services/emrserverless/model/UpdateApplicationResponse.java @@ -1,17 +1,21 @@ package io.floci.aws.services.emrserverless.model; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import io.quarkus.runtime.annotations.RegisterForReflection; +/** UpdateApplication's answer: "Information about the updated application", as GetApplication reports it. */ @RegisterForReflection public class UpdateApplicationResponse { - private String applicationId; - private String arn; - private String name; - public String getApplicationId() { return applicationId; } - public void setApplicationId(String applicationId) { this.applicationId = applicationId; } - public String getArn() { return arn; } - public void setArn(String arn) { this.arn = arn; } - public String getName() { return name; } - public void setName(String name) { this.name = name; } + // Without the clientToken storage keeps, as GetApplicationResponse leaves it out. + @JsonIgnoreProperties("clientToken") + private Application application; + + public Application getApplication() { + return application; + } + + public void setApplication(Application application) { + this.application = application; + } } diff --git a/src/test/java/io/floci/aws/services/emrserverless/EmrServerlessIntegrationTest.java b/src/test/java/io/floci/aws/services/emrserverless/EmrServerlessIntegrationTest.java index 0b2a2b32d0..fa714c171a 100644 --- a/src/test/java/io/floci/aws/services/emrserverless/EmrServerlessIntegrationTest.java +++ b/src/test/java/io/floci/aws/services/emrserverless/EmrServerlessIntegrationTest.java @@ -251,8 +251,14 @@ public class EmrServerlessIntegrationTest { .patch("/applications/" + applicationId) .then() .statusCode(200) - .body("applicationId", equalTo(applicationId)); - + // UpdateApplicationResponse: "Information about the updated application", as GetApplication's. + .body("applicationId", nullValue()) + .body("application.applicationId", equalTo(applicationId)) + .body("application.state", equalTo("STOPPED")) + .body("application.releaseLabel", equalTo("emr-6.7.0")) + .body("application.runtimeConfiguration[0].properties.'spark.executor.memory'", equalTo("4g")) + .body("application", not(hasKey("clientToken"))); + // Verify releaseLabel and new configurations updated givenReq() .when()