- 
                Notifications
    
You must be signed in to change notification settings  - Fork 34
 
allow nil bodies in create resource endpoints #1202
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
Conversation
| Api: nil, | ||
| }, | ||
| want: codes.InvalidArgument, | ||
| }, | 
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.
would it be difficult to keep these tests and change the expected value to codes.OK?
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.
No, I actually did that first... but: 1. it's redundant with the other test and, 2: there are no other OK checks here.
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.
Does 1. mean there are other tests that pass nil resources to create operations? I understand 2. but that's an artifact of the test organization and not really an indication of what we want to test.
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 added test for nil bodies that ensure that both there is no error and that the result is correct: https://github.com/apigee/registry/pull/1202/files#diff-25fea043835f743787d3ac3e0409c0e763af6e9bfdf07b0c7956394e3b604c48R78
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.
But it's fine. I'll add it back in if you'd like.
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.
Thanks, I thought that adding those back might have kept our coverage from dropping (very slightly, but that was surprising) - anyway, this LGTM. Thanks!
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 believe coverage percentage dropped because there is less code to cover. :)
          Codecov Report
 
 @@            Coverage Diff             @@
##             main    #1202      +/-   ##
==========================================
- Coverage   71.90%   71.86%   -0.05%     
==========================================
  Files         146      146              
  Lines       12193    12175      -18     
==========================================
- Hits         8767     8749      -18     
  Misses       2746     2746              
  Partials      680      680              
 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more  | 
    
Allow nil when creating:
Fixes #1198