tmp: Disable saving OAS example responses if env var is set

This commit is contained in:
Nimrod Gilboa Markevich 2022-06-14 13:40:23 +03:00
parent 4c0aeb8146
commit a30578c140

View File

@ -9,6 +9,7 @@ import (
"mime/multipart" "mime/multipart"
"net/textproto" "net/textproto"
"net/url" "net/url"
"os"
"sort" "sort"
"strconv" "strconv"
"strings" "strings"
@ -511,7 +512,12 @@ func fillContent(reqResp reqResp, respContent openapi.Content, ctype string, sam
} }
if content.Example == nil && len(exampleMsg) > len(content.Example) { if content.Example == nil && len(exampleMsg) > len(content.Example) {
content.Example = exampleMsg _, disableOasExample := os.LookupEnv("MIZU_DEBUG_DISABLE_OAS_EXAMPLE")
if disableOasExample {
content.Example = nil
} else {
content.Example = exampleMsg
}
} }
} }