cloudformation-cli
cloudformation-cli copied to clipboard
Ensure required property is present in generated documentation
Issue #, if available:
Description of changes:
Whenever the required property was part of a combiner (e.g. anyOf
) in a resource schema, the generated documentation would skip it. This change will ensure that required fields will be flattened and then used by the documentation generator.
You can check a documentation example here where the required property is ignored.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
You can check a documentation example here where the required property is ignored.
Not seeing any differences after this change? None of the properties look like they're required by themselves anyways
Flattened some resource schemas in PRs linked in this issue that should have been better examples for testing, but not seeing changes from this for those previously unflattened schemas either
You can find an example here that I ran with this PR's branch. The fields are required true now instead false.
You can find an example here that I ran with this PR's branch. The fields are required true now instead false.
I'd argue only RepositoryNames
is required there. The other properties are only conditionally required
For reference, the official resource docs use Conditional
as an explicit state when representing conditionally required (i.e. anyOf) properties:
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-as-scheduledaction.html#cfn-as-scheduledaction-maxsize
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html#cfn-s3-bucket-rule-abortincompletemultipartupload
I agree that putting Conditional is the right way, but flattening will not be enough for that logic.