Skip to content

Commit db096ba

Browse files
author
Amine Afia
committed
expose openapi spec througn an endpoint
1 parent 61d5b68 commit db096ba

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmd/api.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ func RunApi(cmd *cobra.Command, args []string) {
4242

4343
// Add Swagger route
4444
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
45+
// Add Swagger JSON endpoint
46+
r.GET("/json", func(c *gin.Context) {
47+
c.File("./docs/swagger.json")
48+
})
4549

4650
root := r.Group("/:chainId")
4751
{

0 commit comments

Comments
 (0)