fyi practically all the new code in
fyi practically all the new code in server is ts, particularly the new apis. but the openapi descriptions are hand crafted
3 Replies
Check out TSOA for v2 implementation. Should be a pretty straightforward migration from your hand curated JSON. If you already have a github issue, post it here and I can take a shot at it. I personally use NestJS for work API development but it requires a complete migration to their opinionated framework. TSOA would allow you to introduce it to new endpoints, keeping the legacy convention in place. Then gradually plugin developers and legacy endpoints can be optionally migrated.
did not quite get the github issue part...but maybe you could take one of the existing vwith OpenAPI descriptions https://github.com/SignalK/signalk-server/tree/master/src/api and demo how TSOA would work there?
GitHub
signalk-server/src/api at master · SignalK/signalk-server
An implementation of a Signal K central server for boats. - SignalK/signalk-server
Yeah I can do a draft PR to demonstrate it
https://github.com/SignalK/signalk-server/compare/master...tonybentley:signalk-server:feat/tsoa
I added a new course endpoint that duplicates the existing one to demonstrate how it can be migrated. Check out the migration guide to understand more about how to incrementally change existing endpoints. This allows the continuation of using static OAS json while implementing the new controller and decorator pattern.