Skip to content

fix(apigateway): correct JsonSchema.additionalItems property type #33879

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

Merged
merged 9 commits into from
Jun 11, 2025

Conversation

jusdino
Copy link
Contributor

@jusdino jusdino commented Mar 23, 2025

Issue #33878

Closes #33878.

Reason for this change

Fix a bug in the JsonSchema interface.

🚨 This is a breaking change, but should be acceptable, since the bug prevented use of the changed interface portion 🚨

Description of changes

Changing the JsonSchema.additionalItems type from JsonSchema[] to JsonSchema | boolean to match Json Schema Draft-04. This enables deployment of API Gateway models that include the additionalItems property.

Describe any new or updated permissions being added

None

Description of how you validated changes

Added an integration test to validate that it fixes the deployment issue.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. p2 labels Mar 23, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team March 23, 2025 02:22
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

(This review is outdated)

@jusdino jusdino changed the title aws-apigateway: Fix JsonSchema additionalItems interface fix: api-gateway JsonSchema additionalItems interface Mar 23, 2025
@aws-cdk-automation aws-cdk-automation dismissed their stale review March 23, 2025 02:25

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

Copy link

codecov bot commented Mar 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.00%. Comparing base (74cbe27) to head (dccc7e8).
Report is 34 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #33879      +/-   ##
==========================================
+ Coverage   83.98%   84.00%   +0.01%     
==========================================
  Files         120      121       +1     
  Lines        6976     6984       +8     
  Branches     1178     1179       +1     
==========================================
+ Hits         5859     5867       +8     
  Misses       1005     1005              
  Partials      112      112              
Flag Coverage Δ
suite.unit 84.00% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk ∅ <ø> (∅)
packages/aws-cdk-lib/core 84.00% <ø> (+0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jusdino
Copy link
Contributor Author

jusdino commented Mar 23, 2025

I think that the CodeBuild check is failing because this is a breaking API change. I'm not sure how to use allowed-breaking-changes.txt to indicate to the check that the break is intentional and should be OK. If I understand the breaking change policy for this project right, this break should be acceptable, since the bug that this PR fixes prevents use of the part of the interface that is changing.

@jusdino jusdino force-pushed the aws-apigateway/fix-json-schema-interface branch from 2e19b50 to a11b526 Compare March 23, 2025 04:05
@jusdino
Copy link
Contributor Author

jusdino commented Mar 27, 2025

@pahud , good morning! Do you have time to take a look at this? I don't want the PR automation to start threatening to auto-close this PR.

@jusdino
Copy link
Contributor Author

jusdino commented Apr 3, 2025

Hey, that's neat ☝️ . We've blown past the 90th percentile 😆.

@pahud do you have time to have a look? It's a pretty straight forward update - just need to have a conversation with whoever is comfortable looking at the break to verify it is acceptable and correct, I hope. Please let me know any way I can help get this moving.

@pahud
Copy link
Contributor

pahud commented Apr 3, 2025

Hi @jusdino

I won't be able to review your PR but I will bring this up to the team for input here. Meanwhile, you can reach out to cdk.dev slack community for community inputs as well.

@pahud
Copy link
Contributor

pahud commented Apr 3, 2025

By the way, as long as your PR passes the CI, it will be in the queue for community review followed by maintainer review.

Check this document for more details: https://github.com/aws/aws-cdk/wiki/CDK-Community-PR-Reviews

@jusdino
Copy link
Contributor Author

jusdino commented Apr 3, 2025

By the way, as long as your PR passes the CI, it will be in the queue for community review followed by maintainer review.

Check this document for more details: https://github.com/aws/aws-cdk/wiki/CDK-Community-PR-Reviews

Yeah, that's kind of what I'm worried about - I can't make this pass CI, since it is a breaking change ☝️. I'll reach out to the slack community and see what mileage I can get.

Thanks for the responses!

Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

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

this isn't a real review -- just a stab at what you might need to get this to pass the build. sorry we are being very obtuse about what gets in the queue for review and what doesn't.

@kaizencc kaizencc changed the title fix: api-gateway JsonSchema additionalItems interface fix(apigateway): JsonSchema additionalItems interface Apr 8, 2025
@github-actions github-actions bot added the effort/medium Medium work item – several days of effort label Apr 8, 2025
@kaizencc kaizencc changed the title fix(apigateway): JsonSchema additionalItems interface fix(apigateway): JsonSchema additionalItems interface is undeployable Apr 8, 2025
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Apr 8, 2025
@Abogical Abogical self-assigned this Jun 3, 2025
Copy link
Member

@Abogical Abogical left a comment

Choose a reason for hiding this comment

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

Hi @jusdino ! Thank you for making the issue and PR.

A unit test would need to be added to check that RestApi.addModel will behave correctly when a boolean or object additionalItems is passed. The test would just check that the additionalItems within the CloudFormation properties is set correctly. The test suite for that is in restapi.test.ts.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jun 3, 2025
@Abogical Abogical changed the title fix(apigateway): JsonSchema additionalItems interface is undeployable fix(apigateway): correct JsonSchema.additionalItems property type Jun 3, 2025
@mergify mergify bot dismissed Abogical’s stale review June 7, 2025 03:40

Pull request has been modified.

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jun 7, 2025
Copy link
Contributor

mergify bot commented Jun 11, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 4e7af1f
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

mergify bot commented Jun 11, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 464d521 into aws:main Jun 11, 2025
16 checks passed
Copy link
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. effort/medium Medium work item – several days of effort p2 pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws-apigateway: JsonSchema additionalItems is undeployable
6 participants