Open ghost opened 4 years ago
might be a silly question, but, if you don't want your operations/methods to be consumed by external parties, can you not simply remove them from the swagger config (json/yaml) file?
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.
Any updates on this one? This seems like a feature miss within swagger-ui. @jjkcharles - your suggestion to remove definitions that should not be externally visible is not a good solution here. The code generation from the yaml/json files should align with the annotations supported - in this case the ability to hide endpoints. There are use cases where the definitions are used to generate the code vs. manually implementing the endpoint definitions in the classes via annotations and that is where the feature miss is here.
Interested in this question as well. Seems no dev is on it.
During the API development this is a very useful feature to have, mainly when you are also using code generator which requires you to keep the spec for that purpose.
We are also looking same kind of feature to hide our admin from swagger ui. Is it done or in progress?
+1 it would be awesome to be able to use the spec for request/response validation without including specific paths in the UI
This would be so useful for us! We have API management service over the top of an API, and that APIM uses the Swagger to decide which API endpoints to permit access to.
Also looking for a solution for this. We are creating our API-Gateway with the same .yaml so it needs to include all the endpoints. however, I do not want to have all endpoints to be accessable by the Enduser. Also : For CORS I need to add OPTIONS route, and also want to hide this
Anyone working on it??
Also looking for a solution for this. We are creating our API-Gateway with the same .yaml so it needs to include all the endpoints. however, I do not want to have all endpoints to be accessable by the Enduser. Also : For CORS I need to add OPTIONS route, and also want to hide this
I have the exact same use case with the OPTIONS route in API Gateway. Right now we're using an action to make a second copy that is served to end-users which is far from ideal.
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:
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!