Skip to content

Commit 2a09d72

Browse files
fredbicasualjim
authored andcommitted
- [x] Fixed panic case whenever a $ref is declared as sibling of response.
Detect and report the case. - [x] Sync'ed list of formats in type.go type switch - [x] Added more tests on formats to extend json-schema test suite with all supported formats in strfmt - [x] Added more tests on default values checks, with all formats in strfmt
1 parent 9129a28 commit 2a09d72

13 files changed

+1436
-44
lines changed

debug.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@
1515
package validate
1616

1717
import (
18+
"fmt"
1819
"log"
1920
"os"
21+
"path/filepath"
22+
"runtime"
2023
)
2124

2225
var (
@@ -31,14 +34,16 @@ func init() {
3134

3235
func debugOptions() {
3336
if Debug {
34-
log.SetFlags(log.LstdFlags | log.Lshortfile)
35-
log.SetPrefix("validate")
37+
//log.SetFlags(log.LstdFlags | log.Lshortfile)
38+
log.SetFlags(log.LstdFlags)
39+
log.SetPrefix("validate:")
3640
}
3741
}
3842

3943
func debugLog(msg string, args ...interface{}) {
4044
// A private, trivial trace logger, based on go-openapi/spec/expander.go:debugLog()
4145
if Debug {
42-
log.Printf(msg, args...)
46+
_, file1, pos1, _ := runtime.Caller(1)
47+
log.Printf("%s:%d: %s", filepath.Base(file1), pos1, fmt.Sprintf(msg, args...))
4348
}
4449
}

0 commit comments

Comments
 (0)