Files
floci/src/main/java/io/github/hectorvent
Yoshiyuki Ohta 4c156df10b fix(apigatewayv2): include corsConfiguration on Api management responses (#933)
`Api` does not currently model `corsConfiguration`, so neither
`ApiGatewayV2Service.createApi` / `updateApi` accept the field from the
inbound request nor do the two response builders
(`ApiGatewayController.toV2ApiNode` and `ApiGatewayV2JsonHandler.toApiNode`)
emit it. Terraform's `aws_apigatewayv2_api.cors_configuration` is therefore
always perceived as drift on every plan against a correctly-configured
emulator.

Introduces a nested `Api.Cors` record mirroring the `Authorizer.JwtConfiguration`
pattern (six AWS-documented sub-fields: allowOrigins, allowMethods, allowHeaders,
exposeHeaders, maxAge, allowCredentials). Adds request extraction via a shared
`toCors(Map)` helper (boolean uses the same defensive
`Boolean.parseBoolean(String.valueOf(...))` style as `Stage.autoDeploy`) and
emits the value from both REST and JSON 1.1 response paths.

Covered by a focused regression test (`ApiCorsConfigurationResponseTest`)
exercising create/get/list, PATCH update, omitted-when-null, the
containsKey-guard against future regression on PATCH-other-field, and a
JSON 1.1 round-trip via `X-Amz-Target` dispatch.

Same Terraform-drift class as #887 (`Route.authorizerId`) and #931
(`Integration.connectionType`, `Authorizer.enableSimpleResponses`).
2026-05-19 21:45:41 -05:00
..