Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix casing of "passthroughBehavior" property #1619

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private static ObjectNode createPreflightIntegration(Map<CorsHeader, String> hea
}
}

// Ensure that the mock integration include the "type" = "mock" property.
return integration.build().toNode().expectObjectNode().withMember("type", "mock");
// Use createIntegration to fix the casing of the passThroughBehavior property.
return AddIntegrations.createIntegration(integration.build());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ public OperationObject updateOperation(
});
}

private ObjectNode createIntegration(
static ObjectNode createIntegration(MockIntegrationTrait integration) {
// The MockIntegrationTrait path doesn't use the context or shape,
// so it's safe to pass null here for those.
return createIntegration(null, null, integration);
}

private static ObjectNode createIntegration(
Context<? extends Trait> context,
OperationShape shape,
Trait integration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"CORS"
],
"x-amazon-apigateway-integration": {
"passThroughBehavior": "when_no_match",
"passthroughBehavior": "when_no_match",
"contentHandling": "CONVERT_TO_TEXT",
"requestTemplates": {
"application/json": "{\"statusCode\":200}"
Expand Down Expand Up @@ -254,7 +254,7 @@
"CORS"
],
"x-amazon-apigateway-integration": {
"passThroughBehavior": "when_no_match",
"passthroughBehavior": "when_no_match",
"contentHandling": "CONVERT_TO_TEXT",
"requestTemplates": {
"application/json": "{\"statusCode\":200}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"CORS"
],
"x-amazon-apigateway-integration": {
"passThroughBehavior": "when_no_match",
"passthroughBehavior": "when_no_match",
"contentHandling": "CONVERT_TO_TEXT",
"requestTemplates": {
"application/json": "{\"statusCode\":200}"
Expand Down Expand Up @@ -254,7 +254,7 @@
"CORS"
],
"x-amazon-apigateway-integration": {
"passThroughBehavior": "when_no_match",
"passthroughBehavior": "when_no_match",
"contentHandling": "CONVERT_TO_TEXT",
"requestTemplates": {
"application/json": "{\"statusCode\":200}",
Expand Down