Skip to content

Commit

Permalink
adding default request timeout in the generated swagger doc
Browse files Browse the repository at this point in the history
Signed-off-by: Chengxuan Xing <chengxuan.xing@kaleido.io>
  • Loading branch information
Chengxuan committed Nov 27, 2023
1 parent c982c2b commit 8c26438
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/fftm/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand Down

0 comments on commit 8c26438

Please sign in to comment.