-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add feature to expose yaml format OpenAPI document #111
Conversation
@ubogdan Please review my PR!!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot. I just have one suggestion so far. I'll test it and let you know
@@ -170,7 +173,20 @@ func EchoWrapHandler(options ...func(*Config)) echo.HandlerFunc { | |||
} | |||
|
|||
_, _ = c.Response().Writer.Write([]byte(doc)) | |||
case "doc.yaml": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already a .yaml file generated, it is probably better to read it directly than doing the conversion from json ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The yaml file is not embedded in the binary so reading it from disk may be a problem,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes perfect sense, thanks for the info. So let's merge it this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I did a few tests and it looks good to me ! Thanks
@EdouardBavoux Thanks fo approval this PR! |
@ubogdan Please review this PR if you have time Thanks. |
@@ -170,7 +173,20 @@ func EchoWrapHandler(options ...func(*Config)) echo.HandlerFunc { | |||
} | |||
|
|||
_, _ = c.Response().Writer.Write([]byte(doc)) | |||
case "doc.yaml": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The yaml file is not embedded in the binary so reading it from disk may be a problem,
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #111 +/- ##
============================================
- Coverage 100.00% 86.36% -13.64%
============================================
Files 1 1
Lines 76 88 +12
============================================
Hits 76 76
- Misses 0 12 +12
☔ View full report in Codecov by Sentry. |
need tests? |
@starcharles Thanks for your contribution. |
* feat: respond yaml format * feat: modify swagger-UI
Describe the PR
add feature to expose yaml format OpenAPI document.
You can see yaml formatted openapi document at "/swagger/doc.yaml" endpoint.
Relation issue
#109
Additional context
It's sometimes comfortable to get yaml format openapi document from Swagger UI.