From b822f6d39b529d311f0d193f21188bf7aa3788eb Mon Sep 17 00:00:00 2001 From: Ingo Date: Mon, 9 Sep 2024 13:13:07 +0200 Subject: [PATCH] move swagger generation to api.go --- lib/api/api.go | 3 +++ lib/api/doc_gen/gen.go | 20 -------------------- 2 files changed, 3 insertions(+), 20 deletions(-) delete mode 100644 lib/api/doc_gen/gen.go diff --git a/lib/api/api.go b/lib/api/api.go index 2ab6486..9d3a5d1 100644 --- a/lib/api/api.go +++ b/lib/api/api.go @@ -25,6 +25,9 @@ import ( "reflect" ) +//go:generate go install github.com/swaggo/swag/cmd/swag@latest +//go:generate swag init --instanceName devicemanager -o ../../docs --parseDependency -d . -g api.go + type EndpointMethod = func(config config.Config, router *http.ServeMux, ctrl Controller) var endpoints = []interface{}{} //list of objects with EndpointMethod diff --git a/lib/api/doc_gen/gen.go b/lib/api/doc_gen/gen.go deleted file mode 100644 index 6626c3b..0000000 --- a/lib/api/doc_gen/gen.go +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2024 InfAI (CC SES) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package main - -//go:generate go install github.com/swaggo/swag/cmd/swag@latest -//go:generate swag init --instanceName devicemanager -o ../../../docs --parseDependency -d .. -g api.go