Showcase strong typed Typescript client and OpenAPI specification proposal #11915
Replies: 2 comments 9 replies
-
@blakeblackshear @NickM-27 Let me know your thoughts on this one. You guys have plenty of experience with Python and the current Flask version being used in the Frigate HTTP API, so let me know if this is easy to do. If this is not easy/is cumbersome to do, then as an alternative, we could move my yml definition into the Frigate project and then show the Open API specification in this page. This way, we would only need to maintain the Open API specification, which IMO is much easier to maintain than markdown. |
Beta Was this translation helpful? Give feedback.
-
I think this looks great, and we should also consider generating the Typescript client to use in the frontend as well so we get better type checking for our frontend code. Do you know of an existing project that we could use as a reference for patterns here? Are you interested in submitting a pull request for this? High level, what I have in mind is:
|
Beta Was this translation helpful? Give feedback.
-
For my ongoing project (intruder-detection) I rely heavily on Frigate NVR and I needed to use its HTTP API.
Doing so I faced some problems:
To create the Typescript client I had to dive deep into the code and read each endpoint. I've tried my best to make sure each endpoint has the required information to build the Open API specification:
The Open API specification for the Frigate HTTP API is available at https://intruder-detection.github.io/frigate-http-api-typescript
This should make it easier for anyone to read through the documentation of the Frigate HTTP API.
The Typescript client that I've created is available at https://github.com/intruder-detection/frigate-http-api-typescript
My proposal, is that we start using some tool that builds the HTTP API specification automatically (e.g., https://pypi.org/project/flask-swagger/).
The benefits would be:
Beta Was this translation helpful? Give feedback.
All reactions