Skip to content

feat(apigatewayv2): close conformance gap to 100%#715

Merged
vieiralucas merged 5 commits intomainfrom
worktree-apigwv2-last-mile
Apr 23, 2026
Merged

feat(apigatewayv2): close conformance gap to 100%#715
vieiralucas merged 5 commits intomainfrom
worktree-apigwv2-last-mile

Conversation

@vieiralucas
Copy link
Copy Markdown
Member

@vieiralucas vieiralucas commented Apr 23, 2026

Summary

  • apigatewayv2 conformance now at 2769/2769 = 100.0% (overall 59954/59954 = 100.00%)
  • Enforces Smithy @required, @Length, @range, and @enum constraints on apigwv2 management handlers so every negative_* probe variant returns a 4xx instead of silently succeeding
  • New helpers: req_str / req_array / req_object for required body fields, check_length / check_range / check_enum for constraint traits, valid_path_id for placeholder/URL-encoded {Name} detection
  • Update* handlers now require their own path id explicitly so put_keyed and put_subresource can't fabricate a new entity when the caller omits the label

Test plan

  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo fmt
  • cargo test -p fakecloud-apigatewayv2 --lib (83 passed)
  • fakecloud-conformance run --services apigateway — 2769/2769
  • fakecloud-conformance run full sweep — 59954/59954 = 100%
  • Baseline updated: conformance-baseline.json

Summary by cubic

Enforces Smithy validation and path-id checks for API Gateway v2 management APIs so invalid requests return 4xx. This brings apigatewayv2 conformance to 100% (2769/2769) and overall to 100% (59954/59954).

  • New Features

    • Added validation helpers (req_str, req_array, req_object, check_length, check_range, check_enum) and valid_path_id. Update operations now require their path id to prevent accidental creates.
    • Normalized empty or placeholder path labels (e.g., {Name}, %7BName%7D) to “missing”, so handlers reject omitted labels with a 400.
  • Bug Fixes

    • Enforced Smithy-required fields and constraints across operations (e.g., DomainName routing mode, ContentHandlingStrategy, RoutingRule Priority and ListRoutingRules MaxResults, portal/product field lengths, TryItState, response-key required on create).
    • Required explicit ids/params where missing before: GetModelTemplate needs ApiId/ModelId; Import/Reimport need Body; ExportApi needs Specification + outputType; UntagResource needs tagKeys; CreateVpcLink needs Name + SubnetIds.
    • Delete operations now return 404 when the resource does not exist; adjusted product page and REST endpoint page responses to strip internal summary-only fields from Create/Update responses.

Written for commit 51a749c. Summary will update on new commits.

…onses

- Product pages and rest endpoint pages store a pageTitle /
  endpoint for Smithy Summary shapes, but the CreateProductPage /
  UpdateProductPage / CreateProductRestEndpointPage /
  UpdateProductRestEndpointPage response shapes don't carry them.
  Stash them under a '_summary_*' prefix in storage and strip on
  response; list_subresources reads the stashed value.
- Translate EndpointDisplayContent (input: None, Overrides) to
  EndpointDisplayContentResponse (output: Body, Endpoint,
  OperationName) rather than echoing input.
- Lifts the apigateway probe baseline from 92.2% -> 95.6% and
  overall conformance from 99.6% -> 99.8%.
Enforces Smithy-declared @required, @Length, @range, and @enum
constraints on the apigwv2 management-API handlers so that negative
probe variants (omit_X / too_long_X / above_max_X / invalid_enum_X)
surface a 4xx instead of silently succeeding.

* Body-field validation for Create/Put/Import ops: req_str / req_array /
  req_object helpers return 400 BadRequestException when a @required
  body field is absent.
* Path-id validation for Delete/Update ops: URL-template tokens that
  arrive as literal `{Name}` or URL-encoded `%7BName%7D` are now
  recognized as invalid (alongside the existing empty-segment rule).
* Length/range/enum checks for RoutingMode, ContentHandlingStrategy,
  TryItState, Portal LogoUri, RumAppMonitorName, PortalProduct
  DisplayName, Description, RoutingRule Priority, ListRoutingRules
  MaxResults, PublishPortal Description.
* Update* handlers now require their path id explicitly so `put_keyed`
  and `put_subresource` can't silently fabricate a new entity when the
  caller omits the label.

Overall conformance: 59954/59954 = 100.00% (apigateway 2769/2769).
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

❌ Patch coverage is 58.18966% with 194 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/fakecloud-apigatewayv2/src/extras.rs 58.00% 194 Missing ⚠️

📢 Thoughts on this report? Let us know!

@vieiralucas vieiralucas merged commit b6e791e into main Apr 23, 2026
47 of 48 checks passed
@vieiralucas vieiralucas deleted the worktree-apigwv2-last-mile branch April 23, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant