Skip to content

Commit 5b32e9d

Browse files
JemDaydaveshanley
authored andcommitted
- Address review comments
1 parent f7602c5 commit 5b32e9d

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

config/config.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ func NewValidationOptions(opts ...Option) *ValidationOptions {
2424

2525
// Apply any supplied overrides
2626
for _, opt := range opts {
27-
// Sanity
2827
if opt != nil {
2928
opt(o)
3029
}

helpers/schema_compiler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111

1212
// ConfigureCompiler configures a JSON Schema compiler with the desired behavior.
1313
func ConfigureCompiler(c *jsonschema.Compiler, o *config.ValidationOptions) {
14-
// Sanity
1514
if o == nil {
15+
// Sanity
1616
return
1717
}
1818

helpers/schema_compiler_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func Test_ValidJSONSchemaWithInvalidContent(t *testing.T) {
7373

7474
jsch, err := NewCompiledSchema("test", []byte(badSchema), nil)
7575

76-
assert.NotNil(t, err, "Expected an error to be thrown")
76+
assert.NoError(t, err, "Expected an error to be thrown")
7777
assert.Nil(t, jsch, "invalid schema compiled!")
7878
}
7979

@@ -87,7 +87,7 @@ func Test_MalformedSONSchema(t *testing.T) {
8787

8888
jsch, err := NewCompiledSchema("test", []byte(badSchema), nil)
8989

90-
assert.NotNil(t, err, "Expected an error to be thrown")
90+
assert.NoError(t, err, "Expected an error to be thrown")
9191
assert.Nil(t, jsch, "invalid schema compiled!")
9292
}
9393

@@ -108,6 +108,6 @@ func Test_ValidJSONSchemaWithIncompleteContent(t *testing.T) {
108108

109109
jsch, err := NewCompiledSchema("test", []byte(incompleteSchema), nil)
110110

111-
assert.NotNil(t, err, "Expected an error to be thrown")
111+
assert.NoError(t, err, "Expected an error to be thrown")
112112
assert.Nil(t, jsch, "invalid schema compiled!")
113113
}

parameters/query_parameters_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ paths:
761761

762762
valid, errors := v.ValidateQueryParams(request)
763763
assert.True(t, valid)
764-
assert.Len(t, errors, 0)
764+
assert.Empty(t, errors)
765765
}
766766

767767
func TestNewValidator_QueryParamInvalidDateFormat(t *testing.T) {
@@ -813,7 +813,7 @@ paths:
813813

814814
valid, errors := v.ValidateQueryParams(request)
815815
assert.True(t, valid)
816-
assert.Len(t, errors, 0)
816+
assert.Empty(t, errors)
817817
}
818818

819819
func TestNewValidator_QueryParamInvalidDateTimeFormat(t *testing.T) {

0 commit comments

Comments
 (0)