-
Notifications
You must be signed in to change notification settings - Fork 601
Omit empty resources #318
Omit empty resources #318
Conversation
for path in resources: | ||
apis.append({'path': '/%s' % path, }) | ||
|
||
apis = [{'path': '/' + path} for path in self.get_resources()] |
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 not use '/%s' % path
?
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.
Because David Beazley told me it's ok.
But in any event, the string formatting in this file is pretty schizophrenic and '%s' % value
is less favourable to '{}'.format(value)
or '{0}'.format(value)
says python docs.
rebase, perhaps? |
By filtering before trying to determine the top-level resources, empty top-level resources will be correctly ignored.
8437bc4
to
f9675ee
Compare
Rebased 💇 |
Investigating the test failures now. |
|
I wasn't aware that It was a good thing your test exercised this, or it would have probably caused some curious issues. |
I've amended the code for handling resource access because I've found a bug that is exercised by one of my use cases. If all of the APIs provided by a Resource are excluded by
handle_resource_access
, and that resource is actually just a label to collect a bunch of similar APIs together, then that Resource will show up. This is problematic because:The problem is solved simply by doing the check at an earlier stage of processing.