feat(aws-apigateway): expand RestApi support to models, parameters and validators#2960
feat(aws-apigateway): expand RestApi support to models, parameters and validators#2960eladb merged 17 commits intoaws:masterfrom julienlepine:julienlepine/apigw-request-model
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 |
eladb
left a comment
There was a problem hiding this comment.
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.
| public readonly modelName: string; | ||
|
|
||
| constructor(scope: Construct, id: string, props: ModelProps) { | ||
| super(scope, id); |
There was a problem hiding this comment.
Follow the new pattern to support physical names (see s3.Bucket for example).
Use PhysicalName constructs
|
Updated based on comments |
eladb
left a comment
There was a problem hiding this comment.
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.
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
| physicalName: props.requestValidatorName, | ||
| }); | ||
|
|
||
| const validatorProps: CfnRequestValidatorProps = { |
There was a problem hiding this comment.
This needs to be “this.physicalName”
There was a problem hiding this comment.
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.
|
|
||
| test.done(); | ||
| }, | ||
|
|
There was a problem hiding this comment.
What about request validation?
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)
eladb
left a comment
There was a problem hiding this comment.
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
designfolderBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.