@@ -72,7 +72,6 @@ func TestBuildDeepMap_BranchCoverage(t *testing.T) {
7272}
7373
7474func TestTransformURLEncodedToSchemaJSON (t * testing.T ) {
75-
7675 t .Run ("Malformed URL Encoding" , func (t * testing.T ) {
7776 res , errs := TransformURLEncodedToSchemaJSON ("bad_encoding=%zz" , nil , nil )
7877 assert .Nil (t , res )
@@ -87,7 +86,6 @@ func TestTransformURLEncodedToSchemaJSON(t *testing.T) {
8786 })
8887
8988 t .Run ("Apply Encoding Rules & Reserved Characters" , func (t * testing.T ) {
90-
9189 props := orderedmap .New [string , * base.SchemaProxy ]()
9290 props .Set ("jsonField" , base .CreateSchemaProxy (& base.Schema {Type : []string {helpers .Object }}))
9391 props .Set ("restricted" , base .CreateSchemaProxy (& base.Schema {Type : []string {helpers .String }}))
@@ -118,7 +116,7 @@ func TestTransformURLEncodedToSchemaJSON(t *testing.T) {
118116
119117 res , errs := TransformURLEncodedToSchemaJSON (`badJson={invalid` , schema , encodings )
120118 assert .Len (t , errs , 1 )
121-
119+
122120 assert .Equal (t , helpers .URLEncodedValidation , errs [0 ].ValidationType )
123121
124122 assert .Equal (t , "{invalid" , res ["badJson" ])
@@ -136,7 +134,6 @@ func TestTransformURLEncodedToSchemaJSON(t *testing.T) {
136134}
137135
138136func TestApplyEncodingRules (t * testing.T ) {
139-
140137 boolPtr := func (b bool ) * bool { return & b }
141138
142139 t .Run ("DeepObject Style" , func (t * testing.T ) {
@@ -190,14 +187,12 @@ func TestValidateEncodingRecursive(t *testing.T) {
190187}
191188
192189func TestCoerceValue (t * testing.T ) {
193-
194190 schemaInt := & base.Schema {Type : []string {helpers .Integer }}
195191 schemaNum := & base.Schema {Type : []string {helpers .Number }}
196192 schemaBool := & base.Schema {Type : []string {helpers .Boolean }}
197193 schemaStr := & base.Schema {Type : []string {helpers .String }}
198194
199195 t .Run ("Complex Schema Aggregation (AllOf)" , func (t * testing.T ) {
200-
201196 s := & base.Schema {
202197 AllOf : []* base.SchemaProxy {
203198 base .CreateSchemaProxy (schemaInt ),
@@ -463,7 +458,6 @@ func TestComplexBodies(t *testing.T) {
463458}
464459
465460func TestValidateURLEncoded (t * testing.T ) {
466-
467461 spec := `openapi: 3.0.0
468462paths:
469463 /collection:
@@ -490,13 +484,14 @@ paths:
490484 valid , errs := v .ValidateURLEncodedStringWithVersion (schema , encoding , "a=1" , 3.1 )
491485 assert .True (t , valid )
492486 assert .Empty (t , errs )
493- valid , errs = v .ValidateURLEncodedStringWithVersion (nil , nil , "a=1" , 3.1 )
487+
488+ valid , _ = v .ValidateURLEncodedStringWithVersion (nil , nil , "a=1" , 3.1 )
494489 assert .False (t , valid )
495490
496491 valid , errs = v .ValidateURLEncodedString (schema , encoding , "a=1" )
497492 assert .True (t , valid )
498493 assert .Empty (t , errs )
499494
500- valid , errs = v .ValidateURLEncodedString (nil , nil , "a=1" )
495+ valid , _ = v .ValidateURLEncodedString (nil , nil , "a=1" )
501496 assert .False (t , valid )
502497}
0 commit comments