From 8c264382b3d7900158ed96fe5994521300708cdb Mon Sep 17 00:00:00 2001 From: Chengxuan Xing Date: Mon, 27 Nov 2023 18:33:14 +0000 Subject: [PATCH] adding default request timeout in the generated swagger doc Signed-off-by: Chengxuan Xing --- pkg/fftm/api.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/fftm/api.go b/pkg/fftm/api.go index 539531b..bfcf246 100644 --- a/pkg/fftm/api.go +++ b/pkg/fftm/api.go @@ -56,6 +56,7 @@ func (m *manager) router(metricsEnabled bool) *mux.Router { swaggerGen := ffapi.NewSwaggerGen(&ffapi.Options{ BaseURL: u.String(), PanicOnMissingDescription: testDescriptions, + DefaultRequestTimeout: config.GetDuration(tmconfig.APIDefaultRequestTimeout), }) doc := swaggerGen.Generate(req.Context(), routes) res.Header().Add("Content-Type", "application/x-yaml") @@ -66,7 +67,9 @@ func (m *manager) router(metricsEnabled bool) *mux.Router { u := req.URL u.Path = "" swaggerGen := ffapi.NewSwaggerGen(&ffapi.Options{ - BaseURL: u.String(), + BaseURL: u.String(), + PanicOnMissingDescription: testDescriptions, + DefaultRequestTimeout: config.GetDuration(tmconfig.APIDefaultRequestTimeout), }) doc := swaggerGen.Generate(req.Context(), routes) res.Header().Add("Content-Type", "application/json")