mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-05-30 19:46:30 +00:00
tmp: Disable saving OAS example responses if env var is set
This commit is contained in:
parent
4c0aeb8146
commit
a30578c140
@ -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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user