OpenAPI
The official SyncTV container image provides OpenAPI JSON and Swagger UI for browsing endpoints, exporting the schema, and generating clients. Self-built binaries need the OpenAPI capability included; check the artifact’s build options if these paths return 404.
Swagger UI
Section titled “Swagger UI”After startup:
http://localhost:8080/swagger-ui/If server.port is changed, replace 8080.
Production example:
https://api.example.com/swagger-ui/OpenAPI JSON
Section titled “OpenAPI JSON”JSON document:
http://localhost:8080/api-docs/openapi.jsonExport:
curl -fsSL http://localhost:8080/api-docs/openapi.json -o openapi.jsonAuthenticated business APIs use Bearer Token security in the OpenAPI document. Public APIs are marked accordingly.
Generate Clients
Section titled “Generate Clients”TypeScript types:
npx openapi-typescript http://localhost:8080/api-docs/openapi.json -o synctv-api.d.tsOpenAPI Generator:
openapi-generator-cli generate \ -i http://localhost:8080/api-docs/openapi.json \ -g typescript-fetch \ -o ./generated/synctv-clientOther compatible tools include orval and Kiota.
Access Control
Section titled “Access Control”Before exposing Swagger UI in production:
- Confirm that the installed artifact includes OpenAPI.
- Allow
/swagger-ui/through the reverse proxy. - Allow
/api-docs/openapi.jsonthrough the reverse proxy. - Restrict access at Ingress, Nginx, gateway, or firewall level if only internal developers should access it.