From 645088897279e4bdc99b0cc8466fa6bdfee0b228 Mon Sep 17 00:00:00 2001 From: EwenQuim Date: Sat, 14 Dec 2024 16:08:29 +0100 Subject: [PATCH] Makes overrideDescription private in BaseRoute --- mux.go | 5 +++-- option.go | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mux.go b/mux.go index bd5c3326..570a655f 100644 --- a/mux.go +++ b/mux.go @@ -58,13 +58,14 @@ type BaseRoute struct { Middlewares []func(http.Handler) http.Handler AcceptedContentTypes []string // Content types accepted for the request body. If nil, all content types (*/*) are accepted. Hidden bool // If true, the route will not be documented in the OpenAPI spec - OverrideDescription bool // Override the default description DefaultStatusCode int // Default status code for the response OpenAPI *OpenAPI // Ref to the whole OpenAPI spec + + overrideDescription bool // Override the default description } func (r *BaseRoute) GenerateDefaultDescription(otherMiddlewares ...func(http.Handler) http.Handler) { - if r.OverrideDescription { + if r.overrideDescription { return } r.Operation.Description = DefaultDescription(r.FullName, append(r.Middlewares, otherMiddlewares...)) + r.Operation.Description diff --git a/option.go b/option.go index 94b37589..a7673237 100644 --- a/option.go +++ b/option.go @@ -277,12 +277,12 @@ func OptionAddDescription(description string) func(*BaseRoute) { } } -// OptionOverrideDescription overrides the default description set by Fuego. -// By default, the description is set by Fuego with some info, +// OptionOverrideDescription overrides the default description set by Fuego. +// By default, the description is set by Fuego with some info, // like the controller function name and the package name. func OptionOverrideDescription(description string) func(*BaseRoute) { return func(r *BaseRoute) { - r.OverrideDescription = true + r.overrideDescription = true r.Operation.Description = description } }