Skip to content
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

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

Open
bastian-src opened this issue Dec 1, 2021 · 7 comments

Comments

@bastian-src
Copy link

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.

@bastian-src bastian-src changed the title [Feature Request] Define custom apidoc section independt from controller name [Feature Request] Define custom apidoc section independent from the controller name Dec 1, 2021
@ofedoren
Copy link
Contributor

ofedoren commented Dec 3, 2021

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

?

@bastian-src
Copy link
Author

bastian-src commented Dec 10, 2021

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 ?

@vinczedani
Copy link

vinczedani commented May 12, 2022

.

@mathieujobin
Copy link
Collaborator

did you mean to say something here @vinczedani ?

@vinczedani
Copy link

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

@davidwessman
Copy link
Contributor

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

@bastian-src
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants