Skip to content
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

correct cache path to use ~1 to represent root #432

Merged
merged 1 commit into from
Feb 24, 2022
Merged

Conversation

liu-ziyang
Copy link
Contributor

correct the path used to cache the API doc. The current one is incorrectly formatted

details see:
https://stackoverflow.com/questions/65807902/how-do-i-get-resource-path-for-root-resource-in-apigateway

Copy link
Collaborator

@codemonkey800 codemonkey800 left a comment

Choose a reason for hiding this comment

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

lol LGTM, but what does it mean

@@ -28,7 +28,7 @@ resource aws_api_gateway_method_settings root_cache {
count = var.tags.env == "prod" ? 1 : 0
rest_api_id = var.rest_api_id
stage_name = aws_api_gateway_stage.api_stage.stage_name
method_path = "/GET"
method_path = "~1/GET"
Copy link
Collaborator

Choose a reason for hiding this comment

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

what does this mean lol

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is the escaped "/" in api gateway. I can't find it being documented anywhere either..

Copy link
Contributor Author

@liu-ziyang liu-ziyang Feb 24, 2022

Choose a reason for hiding this comment

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

ah here: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-stage-methodsetting.html

ResourcePath
The resource path for this method. Forward slashes (/) are encoded as ~1 and the initial slash must include a forward slash. For example, the path value /resource/subresource must be encoded as /~1resource~1subresource. To specify the root path, use only a slash (/). To apply settings to multiple resources and methods, specify an asterisk (*) for the HttpMethod and /* for the ResourcePath. This parameter is required when you specify a MethodSetting.

@liu-ziyang liu-ziyang merged commit f5f1f88 into main Feb 24, 2022
@liu-ziyang liu-ziyang deleted the correct-cache-path branch February 24, 2022 22:57
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.

2 participants