-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(aws-apigateway): expand RestApi support to models, parameters and validators #2960
feat(aws-apigateway): expand RestApi support to models, parameters and validators #2960
Conversation
…d validators Fixes #905: "apigateway: "methodResponses" is missing from MethodOptions" Fixes #1695: apigateway: missing support for models Fixes #727: API Gateway: improve API for request parameters and responses Fixes #723: API Gateway: missing features Fixes #2957: RestApi to use logical id as a name for APIs instrea of name of current construct
…d validators Fixes #905: "apigateway: "methodResponses" is missing from MethodOptions" Fixes #1695: apigateway: missing support for models Fixes #727: API Gateway: improve API for request parameters and responses Fixes #723: API Gateway: missing features Fixes #2957: RestApi to use logical id as a name for APIs instrea of name of current construct
…epine/aws-cdk into julienlepine/apigw-request-model
re-aligned with the changes to have the |
Hi Julien! Thank you so much for contributing. We are working hard to stabilize the CDK APIs and tuning them to meet our consistency guidelines. While we work on getting the APIs aligned with our guidelines, we are pausing work on most community PRs starting today. Please continue to report issues and submit feature requests, of course. We expect to get back to work on community PRs within a few weeks. |
Re merged with the latest master commit, and adressed PR comments. |
Merged with 0.36 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, getting there.
A few notes:
- We can't introduce breaking changes any more to any of the APIs, so we'll have to figure out the right way to maintain compat.
- Check out the new pattern we have for allowing physical names.
|
||
constructor(scope: Construct, id: string, props: ModelProps) { | ||
super(scope, id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow the new pattern to support physical names (see s3.Bucket for example).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Use PhysicalName constructs
Updated based on comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting there! Super high quality contribution. Thanks so much for all the effort.
export interface ModelOptions { | ||
/** | ||
* The content type for the model. | ||
* @default None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate in the docs what does it mean not to provide a content type?
Also, the value in @default should be “-“ to indicate it’s not a “real” value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
physicalName: props.requestValidatorName, | ||
}); | ||
|
||
const validatorProps: CfnRequestValidatorProps = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be “this.physicalName”
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done for Model.ts, for RequestValidator the name is actually kind of useless per se, name is not a property of the CfnRequestValidator, and it's really an Id.
@@ -601,4 +601,34 @@ export = { | |||
|
|||
test.done(); | |||
}, | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about request validation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
Completing migration to PhysicalName Moved JsonSchemaMapper to internal class in util.ts Removed dependency to IConstruct on IModel (and added linter exclusion in package.json)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Please merge from master, update PR description and let me know when you are ready for merge.
Merged and pushed |
Ready to be merged to master. |
Can you please update the PR description so we’ll use it for the merge commit? |
Fixes #905: "apigateway: "methodResponses" is missing from MethodOptions"
Fixes #1695: apigateway: missing support for models
Fixes #727: API Gateway: improve API for request parameters and responses
Fixes #723: API Gateway: missing features
Fixes #2957: RestApi to use logical id as a name for APIs instead of name of current construct
Adds support for JsonSchema in Model
Aligns Model to the PhysicalName convention.
No breaking change, documentation updated
Pull Request Checklist
design
folderBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.