Repository navigation
Implemented nested dict re-cast - #174
darrylabbate merged 1 commit into
Conversation
|
I just realized, I never came across any CFN resource that would have patternProperties 🤔 |
|
Thank you for your contribution. CFN open source team will take a look at the pull request and provide an update. There are some resources that use |
So 3 I didnt use so far! Bummer Do let me know if this passes your tests and requirements :) |
|
Hey @ammokhov |
darrylabbate
left a comment
There was a problem hiding this comment.
I pulled these changes and did some manual integration testing. LGTM.
|
We'll have to add some kind of CLA integration for future PRs, but for now, can you simply respond to this issue with this text to confirm you give us the right to include your contribution to our code base?
License for reference. |
|
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. |
Related to #172
When trying to recast dict items, if the key is not found, it will iterate over the "nested" dict items first.
At first, I had
which works fine. However, then the recast_test would not pass as the type for
json_data[k][_child]would be that ofclsinstead of more "primitive" ones.Drawback to that is that in the handlers code, every object is a
dictinstead of being of typecls. which means no access to the object attributes directly.Welcome for suggestions on how to keep the typing in handlers when using
modelinstead of having to deal in puredictEdit 1:
For the record, for the purpose of handlers, casting the nested value to the correct class, then use it and return to CFN works totally fine. In my CFN resource type I left the code as follows
And everything works totally fine.