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

can we have an ignore_hidden override pls? #746

Closed
1 task done
mooseh opened this issue Oct 12, 2023 · 3 comments
Closed
1 task done

can we have an ignore_hidden override pls? #746

mooseh opened this issue Oct 12, 2023 · 3 comments
Labels
question Further information is requested

Comments

@mooseh
Copy link
Contributor

mooseh commented Oct 12, 2023

Scribe version

4.22.0

Your question

so a while back you added config support which is super helpful for those who need 2 sets of documentation
this works great but I was wondering if we could add a 'ignore_hidden' to the config like so


    /*
     * The base URL displayed in the docs. If this is empty, Scribe will use the value of config('app.url').
     */
    'base_url' => null,

    /**
     * overide hidden items
     */

    'ignore_hidden' => true,

and then add the following lines in GroupedEndpointsFromApp

            if ($this->isRouteHiddenFromDocumentation($routeControllerAndMethod) && $this->docConfig->get('ignore_hidden') !== false) {
                c::warn('Skipping route: ' . c::getRouteRepresentation($route) . ': @hideFromAPIDocumentation was specified.');
                continue;
            }

this is so we can have an ALL documentation and then filtered documentations

Docs

@mooseh mooseh added question Further information is requested triage labels Oct 12, 2023
@shalvah
Copy link
Contributor

shalvah commented Oct 12, 2023

this is so we can have an ALL documentation and then filtered documentations

I don't get it. Can you elaborate, possibly with an example?

@shalvah shalvah removed the triage label Oct 12, 2023
@mooseh
Copy link
Contributor Author

mooseh commented Oct 12, 2023

so its a little tricky to explain but i have 2 configs, 1 for users and 1 for admins
the admin routes for the documentation are gated so only admins can reach the /admin/docs path

I need the config/scribe_admin.php config file to have an override for the @hideFromAPIDocumentation
such as ignore_hidden flag in the config.php
so that admins get all the routes even if they are hidden.

maybe i am taking the wrong approach but I feel like this is a quick and helpful solution to my problem

@shalvah
Copy link
Contributor

shalvah commented Dec 26, 2023

Closing this, as there's no plan to add this. This is what the routes -> match rules in the config file are for. In one config file, you can have 'exclude' => 'GET /some_endpoint' to exclude it from that doc.

@shalvah shalvah closed this as completed Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants