-
Notifications
You must be signed in to change notification settings - Fork 51
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 Swagger UI to playground #1979
Conversation
Codecov ReportAll modified lines are covered by tests ✅
@@ Coverage Diff @@
## develop #1979 +/- ##
===========================================
+ Coverage 74.76% 74.78% +0.01%
===========================================
Files 246 246
Lines 24298 24298
===========================================
+ Hits 18166 18169 +3
+ Misses 4918 4916 -2
+ Partials 1214 1213 -1
Flags with carried forward coverage won't be shown. Click here to find out more. see 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
display: flex; | ||
flex-direction: column; | ||
gap: 16px; | ||
.swagger-ui .opblock .opblock-summary { |
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.
question: Is any of this css hand crafted, or is it some default stuff copy-pasted from somewhere?
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.
I went through and manually updated the styles for dark mode. They don't have css variable support in Swagger UI so this was the next best option.
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.
LGTM - everything looks to be shaping up nicely :)
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.
LGTM! I love the fact that the UI is auto generated for the openapi endpoint response.
## Relevant issue(s) Resolves sourcenetwork#1978 ## Description This PR updates the playground with a [Swagger UI](https://swagger.io/tools/swagger-ui/) tab that allows users to view and interact with the DefraDB API. The UI is auto generated from the OpenAPI specification served from the `/openapi.json` endpoint. <img width="1608" alt="Screenshot 2023-10-17 at 11 02 12 AM" src="https://github.com/sourcenetwork/defradb/assets/1862560/54f9d6c4-82ef-4580-b021-d0e3e36d7534"> ## Tasks - [x] I made sure the code is well commented, particularly hard-to-understand areas. - [x] I made sure the repository-held documentation is changed accordingly. - [x] I made sure the pull request title adheres to the conventional commit style (the subset used in the project can be found in [tools/configs/chglog/config.yml](tools/configs/chglog/config.yml)). - [x] I made sure to discuss its limitations such as threats to validity, vulnerability to mistake and misuse, robustness to invalidation of assumptions, resource requirements, ... ## How has this been tested? Manually Specify the platform(s) on which this was tested: - MacOS
Relevant issue(s)
Resolves #1978
Description
This PR updates the playground with a Swagger UI tab that allows users to view and interact with the DefraDB API. The UI is auto generated from the OpenAPI specification served from the
/openapi.json
endpoint.Tasks
How has this been tested?
Manually
Specify the platform(s) on which this was tested: