fix(apigatewayv2): return stage tags across protocols (#2413)

* fix(apigatewayv2): return stage tags across protocols

* test(apigatewayv2): cover reserved stage tag stripping
This commit is contained in:
Saatvik Arya authored and GitHub committed 2026-08-19 23:50:48 -05:00
1 parent 5ed3a8cad9
commit 5744082c5e
7 files changed
+107 -8

No files matched your search

@@ -2181,6 +2181,10 @@ public class ApiGatewayController {
ObjectNode stageVariables = node.putObject("stageVariables");
s.getStageVariables().forEach(stageVariables::put);
}
if (s.getTags() != null && !s.getTags().isEmpty()) {
ObjectNode tags = node.putObject("tags");
s.getTags().forEach(tags::put);
}
return node;
}
@@ -632,6 +632,10 @@ public class ApiGatewayV2JsonHandler {
ObjectNode stageVariables = node.putObject("StageVariables");
s.getStageVariables().forEach(stageVariables::put);
}
if (s.getTags() != null && !s.getTags().isEmpty()) {
ObjectNode tags = node.putObject("Tags");
s.getTags().forEach(tags::put);
}
return node;
}
@@ -711,7 +715,8 @@ public class ApiGatewayV2JsonHandler {
if (!key.isEmpty() && Character.isUpperCase(key.charAt(0))) {
key = Character.toLowerCase(key.charAt(0)) + key.substring(1);
}
result.put(key, normalizeValue(entry.getValue()));
Object value = "tags".equals(key) ? entry.getValue() : normalizeValue(entry.getValue());
result.put(key, value);
}
return result;
}
@@ -593,6 +593,12 @@ public class ApiGatewayV2Service {
Map<String, String> stageVariables = (Map<String, String>) request.get("stageVariables");
stage.setStageVariables(stageVariables);
@SuppressWarnings("unchecked")
Map<String, String> tags = (Map<String, String>) request.get("tags");
if (tags != null) {
stage.setTags(ReservedTags.stripApiGatewayReservedTags(tags));
}
stageStore.put(stageKey(region, apiId, stage.getStageName()), stage);
LOG.infov("Created stage: {0} for API {1}", stage.getStageName(), apiId);
return stage;
@@ -3,6 +3,7 @@ package io.github.hectorvent.floci.services.apigatewayv2.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.util.HashMap;
import java.util.Map;
@RegisterForReflection
@@ -14,6 +15,7 @@ public class Stage {
private long createdDate;
private long lastUpdatedDate;
private Map<String, String> stageVariables;
private Map<String, String> tags = new HashMap<>();
public Stage() {}
@@ -34,4 +36,7 @@ public class Stage {
public Map<String, String> getStageVariables() { return stageVariables; }
public void setStageVariables(Map<String, String> stageVariables) { this.stageVariables = stageVariables; }
public Map<String, String> getTags() { return tags; }
public void setTags(Map<String, String> tags) { this.tags = tags; }
}