-
Notifications
You must be signed in to change notification settings - Fork 386
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
OpenAPI Endpoint #3705
Comments
I am not very familiar with OpenAPI except that it's a descriptor of some kind. The app generates the current help from its internal structures so depending on how complicated OpenAPI is (need to look into it) it might be possible to create and maintain an OpenAPI specification. Will tag this as an enhancement. |
What framework is BetterDisplay using for it's RESTful APIs? My best guess would be Vapor. Here's ChatGPT's guide on the least intrusive approach (of course, may as well be a complete BS): To integrate OpenAPI into a Vapor project with no required changes to existing routes, use VaporToOpenAPI. 1. Add DependencyAdd the library to your .package(url: "https://github.com/dankinsoid/VaporToOpenAPI.git", from: "1.0.0") 2. Expose OpenAPI SpecificationExpose the OpenAPI specification without modifying existing routes: app.get("openapi.json") { req in
req.application.routes.openAPI(
info: InfoObject(
title: "My Vapor API",
description: "API documentation for My Vapor App.",
version: "1.0.0"
)
)
} |
It does not use any framework, as there is a common interpreter for HTTP, command line, macOS notification dispatch, the entire thing is totally custom-written. |
It's because I reused a simple lightweight Swift implementation for HTTP: https://github.com/isaced/Aoxiang I am not sure it is hardened in any way against any kind of attacks, this is meant for maybe for a home enthusiast integration thing only or some one-off projects - after all it's about controlling a display of one specific Mac. :) But if it is any trouble, I can remove that. Felt like a nice touch not to though. |
Anyway, I removed the header for the sake of security through obscurity. |
As a user I would like to generate BetterDisplay HTTP clients in multiple languages from an OpenAPI endpoint exposed by BetterDisplay.
For example, it will allow to no-code integrate BetterDisplay with Node-Red using this package:
https://flows.nodered.org/node/openapi-red
The text was updated successfully, but these errors were encountered: