question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there a way to disable/hide an endpoint in swagger file (json/doc/yamlConfig)?

See original GitHub issue

Hi,

I have generated a Swagger for an API consisting of both internal and external methods. The internal methods should not be consumed by external clients, and thus not exposed in my API Gateway afterwards.

I want to expose to my gateway just a white list of controllers/actions, I thought to update the swagger json/yaml config like this for example:

"paths": {
    "/api/BankAccountApi/GetBankAccount": {
           "post": {
                 "tags": [
                     "internal"
                   ],
                   "hidden": true // this what I'm looking for

Is there a way to remove/hide/disable certain methods from swagger specification? Any annotations we could use, to flag methods as private or public or any alternative?

Thank you!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:5
  • Comments:7

github_iconTop GitHub Comments

17reactions
paulmwatsoncommented, Nov 17, 2020

Being able to hide a path from the Swagger UI would be useful. Still accessible via the API just not shown in the UI. We have some “admin” paths we don’t need to show our API users.

1reaction
Kryan90commented, Aug 23, 2022

+1 it would be awesome to be able to use the spec for request/response validation without including specific paths in the UI

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found