-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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: Allow Implicit HTTP APIs to write when value of method is None #2413
Conversation
SAM would crash if a the customer was using Implicit APIs that had a method whose value was None/Null. SAM assumed the value would be a dictonary and therefore would crash with a NoneType error when adding a key/value pair.
tests/openapi/test_openapi.py
Outdated
}, | ||
} | ||
|
||
self.editor = OpenApiEditor(self.original_openapi) | ||
|
||
def test_must_override_null_path(self): | ||
path = "/newpath" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you explain what you are trying to test here. my understanding is you are testing that the /nullmethod
path in the original_openapi
defined in the setUp
method will be override. But I am not able to understand why you used /newpath
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I swear I updated this.. It should be /nullmethod
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did change it locally but somehow got a conflict and didn't update. Not sure how this happened but will be updated in the next diff.
@@ -0,0 +1,89 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did this file got changed? I am not able to understand how it is related to this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I got tired out our long list of file names in our tests and instead make it auto created (like we do for error files). With that, the function_with_alias_and_code_shas256
test cases were never run (where not in the list). Therefore the outputs where not passing (and we were missing two .json
files too). So instead of splitting this, I just combined them. I can split them out of this commit and into it's own if you thing that is best. Was being a bit lazy honestly and the PR was small enough that it felt ok.
Codecov Report
@@ Coverage Diff @@
## develop #2413 +/- ##
===========================================
+ Coverage 93.58% 94.44% +0.86%
===========================================
Files 90 98 +8
Lines 6124 7261 +1137
Branches 1260 1507 +247
===========================================
+ Hits 5731 6858 +1127
- Misses 183 195 +12
+ Partials 210 208 -2
Continue to review full report at Codecov.
|
SAM would crash if a the customer was using Implicit APIs that had a method
whose value was None/Null. SAM assumed the value would be a dictonary and therefore
would crash with a NoneType error when adding a key/value pair.
Issue #, if available:
N/A
Description of changes:
SAM would crash if a the customer was using Implicit APIs that had a method
whose value was None/Null. SAM assumed the value would be a dictonary and therefore
would crash with a NoneType error when adding a key/value pair.
Description of how you validated changes:
Ran the example in the tests before the change, which produced a crash. The tests passed with the patch applied.
Checklist:
make pr
passesExamples?
Please reach out in the comments, if you want to add an example. Examples will be
added to
sam init
through https://github.com/awslabs/aws-sam-cli-app-templates/By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.