1
0
mirror of https://github.com/kubeshark/kubeshark.git synced 2025-05-04 14:48:30 +00:00

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"
"net/textproto"
"net/url"
"os"
"sort"
"strconv"
"strings"
@ -511,7 +512,12 @@ func fillContent(reqResp reqResp, respContent openapi.Content, ctype string, sam
}
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
}
}
}