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
Fixes #7307 - Refactor errata/package/package group APIs #4629
Conversation
Testing this |
param :repository_id, :number, :desc => N_("repository identifier") | ||
param_group :search, Api::V2::ApiController | ||
def index | ||
super |
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.
by having 2 different index methods doesn't the apipie doc for the index action get included twice? (or am i remembering incorrectly).
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 think that's when you include a module that uses alias_method_chain
. I double checked and the apidoc is correct (it doesn't have a content_view_filter_id param or two sets of paths, etc)
Only weirdness I noticed was if I hit a package group filter with the following:
I get
|
before_filter :find_content_resource, :only => [:show] | ||
end | ||
|
||
extend ::Apipie::DSL::Concern |
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.
What about putting the extend
's together to make them easier to find?
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 got this from the taxonomies module in foreman. I tried moving both extend
calls above the included
block but then I got:
wrong number of arguments (0 for 1)
apipie-rails (0.2.4) lib/apipie/dsl_definition.rb:353:in `included`
/home/dadavis/Projects/katello/app/controllers/katello/concerns/api/v2/repository_content_controller.rb:19:in `<module:RepositoryContentController>'
/home/dadavis/Projects/katello/app/controllers/katello/concerns/api/v2/repository_content_controller.rb:15:in `<module:Concerns>'
/home/dadavis/Projects/katello/app/controllers/katello/concerns/api/v2/repository_content_controller.rb:14:in `<module:Katello>'
/home/dadavis/Projects/katello/app/controllers/katello/concerns/api/v2/repository_content_controller.rb:13:in `<top (required)>'
When I moved both after:
wrong number of arguments(0 for 1)
/home/dadavis/Projects/katello/app/controllers/katello/concerns/api/v2/repository_content_controller.rb:16:in `included'
/home/dadavis/Projects/katello/app/controllers/katello/concerns/api/v2/repository_content_controller.rb:16:in `<module:RepositoryContentController>'
/home/dadavis/Projects/katello/app/controllers/katello/concerns/api/v2/repository_content_controller.rb:15:in `<module:Concerns>'
/home/dadavis/Projects/katello/app/controllers/katello/concerns/api/v2/repository_content_controller.rb:14:in `<module:Katello>'
/home/dadavis/Projects/katello/app/controllers/katello/concerns/api/v2/repository_content_controller.rb:13:in `<top (required)>'
Looks like it needs to be this way.
Added a check for the filter type so it checks filter type vs content. Also added a test. |
ACK |
Fixes #7307 - Refactor errata/package/package group APIs
Original task was to add missing params to the package group API but noticing some similarities among packages/errata/package groups APIs, I made the code more DRY as well.