-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
wafv2: CfnWebACL.JsonMatchPatternProperty.all
doesn't accept any
value as documented
#30666
Comments
@gravieure , thanks for reaching out. I am not able to reproduce the issue. Could you please share a minnimal reproducible code snippet? |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
The sample code in the documentation is a reproducer. You can reproduce the other described behavior by changing the |
@gravieure , Thanks for clarification. Since this is a CFN issue, please create an issue with the CFN team here on their Cloudformation coverage map and follow that one for updates/resolution. Thanks. |
I apologize for not understanding, but could you explain why this is CFN issue? The type specified in CDK's code is incorrect -- the declared type is Are the types in the CDK code, and the examples in the CDK documentation generated from CFN? |
Ah My Bad @gravieure , I missed comprehending the whole context. I will dive deep and get back to you |
@gravieure , AFAIK, the doc generation is from jsii-docgen which generates the API.md and we tend to write the original implementation in TypeScript and have jsii-docgen to generate docs for different languages. I noticed in the Tyepscript as well as Python doc that Also CfnWebACL is cloudformation resource (Doc) - |
Thank you for the explanations. I note that the same incorrect type and example exists in the TypeScript docs and example -- the field type is It's extra confusing in Python, though, because an empty dict is treated as false -- so a false value in the host language is used as a true value by CDK. Are there any plans to improve this API? I've found it much more difficult to work with than other CDK APIs, and since WAF is an important security control, I think the chances of getting something wrong in a way that negatively impacts security is high. |
@gravieure , thanks for keeping patience! I don't have any ETA but team surely has plans of improving the docs experience for the community. |
Thank you. Please note that there are two components to my report: code problems and documentation problems. The code is buggy, because it declares that certain fields can accept values of The examples in the documentation are incomplete and incorrect, which I suspect is because it's some kind of auto-generated output based on the code, which is buggy. |
Describe the bug
This pertains to the Python bindings, but I believe the issue affects TypeScript as well, though to a lesser degree.
The documentation for
JsonMatchPatternProperty.all
states:However, if I specify
all=True
,cdk synth
fails:So the type hint is incorrect; a value of
Any
type is not legal for theall
argument.The example code in the documentation is:
This violates the immediately preceding text, "You must specify either this setting or the IncludedPaths setting, but not both." Specifying only
all=all
does not work;all
is a built-in function in Python, which causes a JSII error:It appears that I have to pass some JSII-serializable value here to indicate truthy state, such as:
This is a very unusual way to express a boolean, particularly because an empty dict is considered
False
in Python:Expected Behavior
all
attribute would work.Current Behavior
Reproduction Steps
JsonMatchPatternProperty
whoseall
value isall
, as the example code does.or
JsonMatchPatternProperty
whoseall
value isTrue
.Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.147.1 (build d3695d4)
Framework Version
2.147.1
Node.js Version
v18.15.0
OS
macOS Sonoma 14.5 (23F79)
Language
Python
Language Version
Python 3.10.7
Other information
The TypeScript documentation also says that
all?
can acceptany
type, though this is not true.The text was updated successfully, but these errors were encountered: