Swagger expose "/documentation/*" endpoint
See original GitHub issueHi, i have an issue that i dont know if to others happend but in swagger is loading the /documentation/* endpoint, i resolve if i ask in the fastify-swagger plugin by the condition in dynamic:
if (route.path === 'documentation/*' || route.schema && route.schema.hide)
but i dont know if is the correct way because maybe someone just resolvered.
This is the json that swagger generates with only one endpoint:
{
"swagger":"2.0",
"info":{
"version":"1.0.0",
"title":"API Documentation",
"description":"API Endpoints Documentation"
},
"schemes":[
"https",
"http"
],
"consumes":[
"application/json"
],
"produces":[
"application/json"
],
"paths":{
"/documentation/*":{
"get":{
"responses":{
"200":{
"description":"Default Response"
}
}
}
},
"/v1/keep-alive":{
"get":{
"summary":"Obtain the status of the API",
"description":"Get the status of the API",
"tags":[
"Info"
],
"responses":{
"200":{
"schema":{
"description":"Succesful response",
"type":"string"
},
"description":"Succesful response"
},
"400":{
"schema":{
"description":"Not Found response",
"type":"string"
},
"description":"Not Found response"
},
"500":{
"schema":{
"description":"Error response",
"type":"object",
"properties":{
"error":{
"type":"string"
},
"message":{
"type":"string"
},
"statusCode":{
"type":"number"
}
}
},
"description":"Error response"
}
}
}
}
}
}
and this is my config:
{
"swagger":{
"info":{
"version":"1.0.0",
"title":"API Documentation",
"description":"API Endpoints Documentation"
},
"schemes":[
"http"
],
"consumes":[
"application/json"
],
"produces":[
"application/json"
]
},
"exposeRoute":true
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
API Documentation Made Easy with OpenAPI & Swagger
Swagger Inspector is an easy to use developer tool to quickly execute any API request, validate its responses and generate a corresponding OpenAPI...
Read more >RESTful API Documentation Made Easy with Swagger and ...
Swagger and OpenAPI specification lets us design and develop REST APIs in an effortless and seamless manner.
Read more >Swagger UI tutorial | Documenting APIs - Idratherbewriting.com
Activity: Create a Swagger UI display with an OpenAPI spec document · Go to the Swagger UI GitHub project. · Click Clone or...
Read more >Swagger: How to Create an API Documentation - YouTube
A good documentation is crucial for any REST API. Swagger is a tool that can help in both creating and displaying such a...
Read more >Hiding Endpoints From Swagger Documentation in Spring Boot
... look at how we can hide endpoints from Swagger API documentation. ... documentation, we often need to hide endpoints from being exposed...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think we just need to pass
schema: { hide: true }
to all route definitions in fastify-static. There is no need for a hook.https://github.com/fastify/fastify-static/pull/59