From 1db1b84e8f9ee514f4c8e30fe35ac942e380d75e Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Fri, 29 Mar 2024 15:58:36 +0100 Subject: [PATCH] Initial demo of swagger-typescript-api interface generation --- .gitignore | 1 + backend/Makefile | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index 3b1c6d3..281e866 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ backend/*.svg /go.work.sum /package-lock.json +/backend/docs/swagger.json # Test binary, built with `go test -c` *.test diff --git a/backend/Makefile b/backend/Makefile index 3443e94..4e6e20e 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -104,6 +104,12 @@ default: build docs: swag init -outputTypes go +api: ./docs/swagger.json + npx swagger-typescript-api --path ./docs/swagger.json --output ../frontend/src/API --name GAPI.ts + +./docs/swagger.json: + swag init -outputTypes json + .PHONY: docfmt docfmt: swag fmt