Apipie / apipie-rails

Ruby on Rails API documentation tool
Apache License 2.0
2.47k stars 459 forks source link

`param_group` throws undefined error unless controller is specified #779

Open ianballou opened 2 years ago

ianballou commented 2 years ago

774 (apipie-rails 0.8.2) seems to have broken some of our code in the Katello project:

    def_param_group :installed_products do
      ...
    end

    def_param_group :subscription_facet_attributes do
      ...
      param :installed_products_attributes, Array, :desc => N_("List of products installed on the host") do
        param_group :installed_products # <----- Throws "param group Api::V2::HostsController#installed_products not defined"
      end
    end

It's fixed if I change the marked line to:

        param_group :installed_products, Api::V2::HostSubscriptionsController

Shouldn't that work without specifying the controller since we're already inside the Api::V2::HostSubscriptionsController ?

mathieujobin commented 2 years ago

thanks for reporting it and including a workaround, this is very helpful.

bruno-m-gomes commented 2 months ago

Stumbled upon this issue today, thanks for the workaround