aws-cloudformation / aws-cloudformation/cloudformation-cli
Resource generation outstanding issues
- Dominant language
- Python
- Stars
- 336
- Forks
- 172
- Avg merge
- 3d 5m
- Merged PRs (30d)
- 3
Description
The current resource generator in #104 handles simpler cases of resource generation. The below items are necessary to bring the generator to a more operable state that can handle most if not all valid resource definition schemas.
- [x] Refs are not handled. This is fine, but needs some kind of step prior to make sure it works
- [ ] Type keywords. Keywords that can be specified in jsonschema draft 07 for primitive types should be accounted for in resource generation. #104 handles some of this but not all (e.g. minLength and maxLength is not supported for arrays).
- [ ] Assuming type is a string. We assume the schema type is a string and cannot be an array. Arrays are valid values for type keys and we need to generate values based off all of the types listed.
- [ ] String formats. jsonschema has a "format" keyword that allows for specific string formats like json pointers, domain names, email addresses, etc. that should be able to be generated by the resource generator. The logic to do this is in place, but we need to construct regular expression strategies that we can map to format names.
- [x] Options to generate more than the required properties. Currently the generator only generates those that are required. Having an option to generate a maximal set of properties would be beneficial for testing the robustness of handlers.
- [x] Combiners. Currently allOf and anyOf are not supported by the generator. anyOf should be a simple addition because it is handled in the same way as oneOf. allOf will require to merge the child schemas.
- [x] Const and enum. Constant values and enum schemas are not supported currently.
- [x] Needs to only generate a resource blob (i.e. the stuff under properties)
- [x] Refactor generation functions for readability.
- [ ] https://github.com/aws-cloudformation/cloudformation-cli/issues/287
Also, some research needs to be done to see if the flattener and resource generator can be combined in some way. They are both walking the schema in a similar way, so it would be nice to remove duplicate implementations of this to lessen the amount of code to be maintained.
Contributor guide
Assessment
This issue has not been assessed yet.