Skip to content

Commit b45a81e

Browse files
authored
Merge pull request #127 from jkaninda/dev
feat: add openapi yaml response endpoint(/openapi.yaml)
2 parents 324074f + a759c4a commit b45a81e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

doc.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ func (o *Okapi) registerDocRoutes(title string) {
132132
o.Get(openApiDocPath, func(c *Context) error {
133133
return c.JSON(http.StatusOK, o.openapiSpec)
134134
}).internalRoute().Hide() // Hide the route from the OpenAPI documentation
135+
o.Get("/openapi.yaml", func(c *Context) error {
136+
return c.YAML(http.StatusOK, o.openapiSpec)
137+
}).internalRoute().Hide()
135138
// Register the swagger route
136139
o.Get(openApiDocPrefix, func(c *Context) error {
137140
return c.renderHTML(http.StatusOK, swaggerTemplate, M{"Title": title})

0 commit comments

Comments
 (0)