swagger-api / swagger-api/swagger-ui
Is there a way to disable/hide an endpoint in swagger file (json/doc/yamlConfig)?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
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!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue mentions Swagger/OpenAPI paths and a proposed hidden field, but identifies no repository file, test, or entry point. Start by determining whether endpoint filtering belongs in Swagger UI or the specification generator; done would require a clearly documented and tested way to exclude selected operations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100