Apipie/apipie-rails

[Feature Request] Define custom apidoc section independent from the controller name

bastian-src opened this issue · 7 comments

Hey! I've had a look at your documentation and I can't find a command to achieve the following:

I have an existing controller which is called JobsController. apidoc creates a corresponding section which is called Jobs. Now, I want to change the section name without changing the controller name. Is there any apipie command to define a custom apidoc section name such that it doesn't use the controller name anymore? Something like:

class JobsController
  api_section 'CustomJobs'
...

The reason for this is that I don't want to rename the whole controller (and all its occurrences), but the corresponding documentation shall be listed under a different section name.

Maybe I just overlooked it and the functionality is already given by a command.

Hey :) Thanks for using the library and sorry for the delay. Have you tried to use

class JobsController
  resource_description do
    name 'CustomJobs'
  end
end

?

Hey! thanks for your reply :)
I've tested your suggestion & it changes the name, thanks.

Unfortunately, it doesn't change the order where the entry is listed at the apidoc page. I thought it would be generated alphabetically & change the order if I change the name. Do you have an idea on how to fix this @ofedoren ?

did you mean to say something here @vinczedani ?

yup I wanted to, but then I realised its not in the scope of this issue, so moved it to #759
sorry for the double

I think @vinczedani is correct that it would help to remove the default resource tag to allow the fix from @ofedoren to work.
Hopefully fixed in #881

Alright, thanks for your help! @davidwessman
I guess I'll keep the issue open until that PR is merged.