@@ -48,9 +48,9 @@ func Example_jsonSchema2020Validator() {
4848 }
4949
5050 if err := schema .VisitJSON (validData , openapi3 .EnableJSONSchema2020 ()); err != nil {
51- fmt .Println ("Validation failed:" , err )
51+ fmt .Println ("validation failed:" , err )
5252 } else {
53- fmt .Println ("Valid data passed" )
53+ fmt .Println ("valid data passed" )
5454 }
5555
5656 // Valid with null age
@@ -61,9 +61,9 @@ func Example_jsonSchema2020Validator() {
6161 }
6262
6363 if err := schema .VisitJSON (validWithNull , openapi3 .EnableJSONSchema2020 ()); err != nil {
64- fmt .Println ("Validation failed:" , err )
64+ fmt .Println ("validation failed:" , err )
6565 } else {
66- fmt .Println ("Valid data with null passed" )
66+ fmt .Println ("valid data with null passed" )
6767 }
6868
6969 // Invalid: wrong const value
@@ -74,13 +74,13 @@ func Example_jsonSchema2020Validator() {
7474 }
7575
7676 if err := schema .VisitJSON (invalidData , openapi3 .EnableJSONSchema2020 ()); err != nil {
77- fmt .Println ("Invalid data rejected" )
77+ fmt .Println ("invalid data rejected" )
7878 }
7979
8080 // Output:
81- // Valid data passed
82- // Valid data with null passed
83- // Invalid data rejected
81+ // valid data passed
82+ // valid data with null passed
83+ // invalid data rejected
8484}
8585
8686// Example demonstrates type arrays with null support
@@ -92,21 +92,21 @@ func Example_typeArrayWithNull() {
9292
9393 // Both string and null are valid
9494 if err := schema .VisitJSON ("hello" , openapi3 .EnableJSONSchema2020 ()); err == nil {
95- fmt .Println ("String accepted" )
95+ fmt .Println ("string accepted" )
9696 }
9797
9898 if err := schema .VisitJSON (nil , openapi3 .EnableJSONSchema2020 ()); err == nil {
99- fmt .Println ("Null accepted" )
99+ fmt .Println ("null accepted" )
100100 }
101101
102102 if err := schema .VisitJSON (123 , openapi3 .EnableJSONSchema2020 ()); err != nil {
103- fmt .Println ("Number rejected" )
103+ fmt .Println ("number rejected" )
104104 }
105105
106106 // Output:
107- // String accepted
108- // Null accepted
109- // Number rejected
107+ // string accepted
108+ // null accepted
109+ // number rejected
110110}
111111
112112// Example demonstrates the const keyword
@@ -117,16 +117,16 @@ func Example_constKeyword() {
117117 }
118118
119119 if err := schema .VisitJSON ("production" , openapi3 .EnableJSONSchema2020 ()); err == nil {
120- fmt .Println ("Const value accepted" )
120+ fmt .Println ("const value accepted" )
121121 }
122122
123123 if err := schema .VisitJSON ("development" , openapi3 .EnableJSONSchema2020 ()); err != nil {
124- fmt .Println ("Other value rejected" )
124+ fmt .Println ("other value rejected" )
125125 }
126126
127127 // Output:
128- // Const value accepted
129- // Other value rejected
128+ // const value accepted
129+ // other value rejected
130130}
131131
132132// Example demonstrates the examples field
@@ -144,11 +144,11 @@ func Example_examplesField() {
144144
145145 // Examples don't affect validation, any string is valid
146146 if err := schema .VisitJSON ("yellow" , openapi3 .EnableJSONSchema2020 ()); err == nil {
147- fmt .Println ("Any string accepted" )
147+ fmt .Println ("any string accepted" )
148148 }
149149
150150 // Output:
151- // Any string accepted
151+ // any string accepted
152152}
153153
154154// Example demonstrates backward compatibility with nullable
@@ -162,16 +162,16 @@ func Example_nullableBackwardCompatibility() {
162162
163163 // Automatically converted to type array ["string", "null"]
164164 if err := schema .VisitJSON ("hello" , openapi3 .EnableJSONSchema2020 ()); err == nil {
165- fmt .Println ("String accepted" )
165+ fmt .Println ("string accepted" )
166166 }
167167
168168 if err := schema .VisitJSON (nil , openapi3 .EnableJSONSchema2020 ()); err == nil {
169- fmt .Println ("Null accepted" )
169+ fmt .Println ("null accepted" )
170170 }
171171
172172 // Output:
173- // String accepted
174- // Null accepted
173+ // string accepted
174+ // null accepted
175175}
176176
177177// Example demonstrates complex nested schemas
@@ -222,11 +222,11 @@ func Example_complexNestedSchema() {
222222 }
223223
224224 if err := schema .VisitJSON (validData , openapi3 .EnableJSONSchema2020 ()); err == nil {
225- fmt .Println ("Complex nested object validated" )
225+ fmt .Println ("complex nested object validated" )
226226 }
227227
228228 // Output:
229- // Complex nested object validated
229+ // complex nested object validated
230230}
231231
232232// Example demonstrates using both validators for comparison
@@ -241,16 +241,16 @@ func Example_comparingValidators() {
241241 // Test with built-in validator (no option)
242242 err1 := schema .VisitJSON (testValue )
243243 if err1 != nil {
244- fmt .Println ("Built -in validator: rejected" )
244+ fmt .Println ("built -in validator: rejected" )
245245 }
246246
247247 // Test with JSON Schema 2020-12 validator
248248 err2 := schema .VisitJSON (testValue , openapi3 .EnableJSONSchema2020 ())
249249 if err2 != nil {
250- fmt .Println ("JSON Schema 2020-12 validator: rejected" )
250+ fmt .Println ("visit JSON Schema 2020-12 validator: rejected" )
251251 }
252252
253253 // Output:
254- // Built -in validator: rejected
255- // JSON Schema 2020-12 validator: rejected
254+ // built -in validator: rejected
255+ // visit JSON Schema 2020-12 validator: rejected
256256}
0 commit comments