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

fix(.net): occasional incorrect param type cast #568

Merged
merged 6 commits into from
Jul 1, 2019

Conversation

RomainMuller
Copy link
Contributor

When structures (as literal JSON blocks) get passed through a "map"
argument, a JObject would be passed to the method despite the declared
type on the .NET code is IDictionary, resulting in a crash.

This code forcefully converts JObject to IDictionary<string, objetc>
in such code paths.

Fixes aws/aws-cdk#3093


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

When structures (as literal JSON blocks) get passed through a "map"
argument, a `JObject` would be passed to the method despite the declared
type on the .NET code is `IDictionary`, resulting in a crash.

This code forcefully converts `JObject` to `IDictionary<string, objetc>`
in such code paths.

Fixes aws/aws-cdk#3093
@RomainMuller RomainMuller requested review from costleya and a team as code owners July 1, 2019 10:14
@ghost ghost requested a review from shivlaks July 1, 2019 10:14
@RomainMuller
Copy link
Contributor Author

I'm provisionally waiting to see if @garnaat can teach me how to do Python right before merging this. If we don't get around to it fast enough, I'll be fixing the Python test in a separate PR 🤞🏻

@RomainMuller
Copy link
Contributor Author

Talked with @garnaat offline and managed to get the test to work. Whee.

@RomainMuller RomainMuller merged commit c89d0fa into master Jul 1, 2019
@RomainMuller RomainMuller deleted the rmuller/fix-dotnet branch July 1, 2019 15:01
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.

All Cfn Types broken for .NET in 0.35.0 and 0.36.0
2 participants