feat(api): add openapi specification
Description
This PR will attempt to provide an openapi spec for the Sunshine rest API. I am not an expert on this, but I believe once this is available it will be possible to automatically create SDKs in various languages using an SDK generator (https://openapi.tools/#sdk).
The idea came from https://plexapi.dev/Open-API-Specification which generates SDKs using "Speakeasy". Unfortunately, I don't believe Speakeasy has a generous open source license/option, so other generators may need to be considered. Still, the repo has been a good example, starting with the main spec file - https://github.com/LukeHagar/plex-api-spec/blob/main/src/pms-spec.yaml
Additionally, there are spec generators for various languages, but none seem to be available for c++, understandably, so this is being manually created.
TODO:
- [ ] CI, build API docs using redoc, lint, etc. redoc: https://dev.to/heymich/a-guide-to-creating-api-documentation-with-redoc-and-github-pages-4i4a
- [ ] see if this even works
- [ ] postman, see: https://github.com/Redocly/redoc/issues/2457#issuecomment-2594451010
- [ ] redocly in CLion (not working... probably CORS issue... also same as https://github.com/Redocly/redoc/issues/2457#issuecomment-2594451010)
- [ ] swagger in CLion (not working... probably CORS issue)
- [ ] add all endpoints
- [ ] generate version number (and other variables) during build/release
- [ ] generate/publish SDKs (possibly in separate repos)
- [x] return properly serialized json (boolean, integer) values (probably not this PR)... then remove "types" directory
Other notes:
- if redoc doesn't work out... standalone linting: https://github.com/stoplightio/spectral
- might be better to use a different web framework: https://github.com/oatpp/oatpp-swagger
Screenshot
Issues Fixed or Closed
Type of Change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Dependency update (updates to dependencies)
- [x] Documentation update (changes to documentation)
- [ ] Repository update (changes to repository files, e.g.
.github/...)
Checklist
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated the in code docstring/documentation-blocks for new or existing methods/components
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 11.62%. Comparing base (257a102) to head (5b863f7).
:warning: Report is 293 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #3540 +/- ##
=======================================
Coverage 11.62% 11.62%
=======================================
Files 93 93
Lines 17319 17319
Branches 8085 8085
=======================================
Hits 2014 2014
Misses 12823 12823
Partials 2482 2482
| Flag | Coverage Δ | |
|---|---|---|
| Linux | 11.30% <ø> (ø) |
|
| Windows | 13.04% <ø> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
It looks like this PR has been idle for 90 days. If it's still something you're working on or would like to pursue, please leave a comment or update your branch. Otherwise, we'll be closing this PR in 10 days to reduce our backlog. Thanks!
It looks like this PR has been idle for 90 days. If it's still something you're working on or would like to pursue, please leave a comment or update your branch. Otherwise, we'll be closing this PR in 10 days to reduce our backlog. Thanks!
This PR was closed because it has been stalled for 10 days with no activity.