Skip to content

Commit 0e805b1

Browse files
fredbicasualjim
authored andcommitted
44 FIX - Improve spec validation messages (go-openapi#42)
* Initial commit. Do not merge * Good enough. UT perhaps borderline with default 10min timeout on my machine... * Fixed FailNow() exception. Removed unused loop in code * Externalized expected messages for UT in yaml. Trying to reproduce CI pb * Skipped from CI: long running test MessageQualityContinueOnErrors_Issue44 * Skip another message validation UT... * Skipped 2 more long running UT * Bump and check if spec pkg still broken * Bump to CI * More UT. Arg in test to skip/pass long running tests * Cleaned up un-necessary files in ./fixtures/go-swagger copied from go-swagger/go-swagger * +UT for hasDuplicate() (never used in code). BTW this method should probably be removed. It looks like it is obsolete and superseded by values.go:UniqueItems() * set mutex on regexp cache * Fix mutex w/ panic testcase on mustCompileRegexp
1 parent 32db5cd commit 0e805b1

File tree

160 files changed

+121596
-372
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+121596
-372
lines changed

debug.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package validate
2+
3+
import (
4+
"log"
5+
"os"
6+
)
7+
8+
var (
9+
// Debug is true when the SWAGGER_DEBUG env var is not empty
10+
Debug = os.Getenv("SWAGGER_DEBUG") != ""
11+
)
12+
13+
func debugLog(msg string, args ...interface{}) {
14+
// a private, trivial trace logger, based on go-openapi/spec/expander.go:debugLog()
15+
if Debug {
16+
log.Printf(msg, args...)
17+
}
18+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
swagger: "2.0"
2+
paths:
3+
/widgets/:
4+
get:
5+
summary: Retrieve all widgets.
6+
parameters:
7+
- name: category_id
8+
in: query
9+
description: Return the widgets that are associated with this category.
10+
required: true
11+
type: array
12+
collectionFormat: "multi"
13+
items:
14+
type: string
15+
pattern: '^[0-9abcdefghjkmnpqrtuvwxyz]{29}$'
16+
definitions: {}

0 commit comments

Comments
 (0)