Api and Handler overhaul - #136
Merged
Merged
Conversation
…nctions and communication
Closed
eyip002
requested changes
Sep 10, 2025
eyip002
left a comment
Member
There was a problem hiding this comment.
Very good and substantial work! I'm glad so see that the responses are now in JSON. Admittedly, I did not look at every single line, but I scanned for obvious code smells. I let you do some more testing to iron out any hidden bugs before finalising the merge.
eyip002
approved these changes
Sep 24, 2025
eyip002
left a comment
Member
There was a problem hiding this comment.
You can merge when you are ready 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #128.
Alright, the big overhaul, moving to an OpenAPI-documented API with a REST-like interface, most importantly with JSON as a response format for all endpoints (2 old debug endpoints have been left as-is).
A lot of other stuff was also adjusted - some optimizations, some additional safety checks, and so on. Maybe this should have been multiple smaller PRs, but the API overhaul means we have to touch almost everything anyways.
The changes were tested with the python client and the web clients. Pretty much all "happy paths" have probably been tested, and also a few unhappy paths were we could trigger them easily.
There is however a little bit of stuff left to test in the Javascript parts, so one or two more test sessions are needed there.
Note that
get_signal_detailsis intentionally not implemented at this point - for now its more important to get this API update out there.Also, some new TODOs have been added; I just think the PR is getting too big already, and all the TODOs that are not trivially done or crucial to SWTbahn operation can wait.
Another note: We changed
size_tto unsigned int (or similar) where easily done, because the older raspberry pi's (32bit...) have a different type defined for that than on x86-64, which makes print format specifiers annoying.Big question is of course, how do we actually review this. It's probably/maybe too much code to do piece by piece.
Maybe we should focus on the new files added (specifically for json building and communication stuff), and how they are used.
The JS client stuff should go last, as some changes might still be required there.