-
-
Notifications
You must be signed in to change notification settings - Fork 239
/
value.go
927 lines (811 loc) · 19.9 KB
/
value.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
package httpexpect
import (
"errors"
"reflect"
)
// Value provides methods to inspect attached interface{} object
// (Go representation of arbitrary JSON value) and cast it to
// concrete type.
type Value struct {
chain *chain
value interface{}
}
// NewValue returns a new Value instance.
//
// If reporter is nil, the function panics.
// Value may be nil.
//
// Example:
//
// value := NewValue(t, map[string]interface{}{"foo": 123})
// value.IsObject()
//
// value := NewValue(t, []interface{}{"foo", 123})
// value.IsArray()
//
// value := NewValue(t, "foo")
// value.IsString()
//
// value := NewValue(t, 123)
// value.IsNumber()
//
// value := NewValue(t, true)
// value.IsBoolean()
//
// value := NewValue(t, nil)
// value.IsNull()
func NewValue(reporter Reporter, value interface{}) *Value {
return newValue(newChainWithDefaults("Value()", reporter), value)
}
// NewValueC returns a new Value instance with config.
//
// Requirements for config are same as for WithConfig function.
// Value may be nil.
//
// See NewValue for usage example.
func NewValueC(config Config, value interface{}) *Value {
return newValue(newChainWithConfig("Value()", config.withDefaults()), value)
}
func newValue(parent *chain, val interface{}) *Value {
v := &Value{parent.clone(), nil}
opChain := v.chain.enter("")
defer opChain.leave()
if val != nil {
v.value, _ = canonValue(opChain, val)
}
return v
}
// Raw returns underlying value attached to Value.
// This is the value originally passed to NewValue, converted to canonical form.
//
// Example:
//
// value := NewValue(t, "foo")
// assert.Equal(t, "foo", number.Raw().(string))
func (v *Value) Raw() interface{} {
return v.value
}
// Decode unmarshals the underlying value attached to the Object to a target variable
// target should be pointer to any type.
//
// Example:
//
// type S struct {
// Foo int `json:"foo"`
// Bar []interface{} `json:"bar"`
// Baz struct{ A int } `json:"baz"`
// }
//
// m := map[string]interface{}{
// "foo": 123,
// "bar": []interface{}{"123", 456.0},
// "baz": struct{ A int }{123},
// }
//
// value = NewValue(reporter,m)
//
// var target S
// value.Decode(&target)
//
// assert.Equal(t, S{123, []interface{}{"123", 456.0}, struct{ A int }{123}, target})
func (v *Value) Decode(target interface{}) *Value {
opChain := v.chain.enter("Decode()")
defer opChain.leave()
if opChain.failed() {
return v
}
canonDecode(opChain, v.value, target)
return v
}
// Alias returns a new Value object with alias.
// When a test of Value object with alias is failed,
// an assertion is displayed as a chain starting from the alias.
//
// Example:
//
// // In this example, GET /example responds "foo"
// foo := e.GET("/example").Expect().Status(http.StatusOK).JSON().Object()
//
// // When a test is failed, an assertion without alias is
// // Request("GET").Expect().JSON().Object().IsEqual()
// foo.IsEqual("bar")
//
// // Set Alias
// fooWithAlias := e.GET("/example").
// Expect().
// Status(http.StatusOK).JSON().Object().Alias("foo")
//
// // When a test is failed, an assertion with alias is
// // foo.IsEqual()
// fooWithAlias.IsEqual("bar")
func (v *Value) Alias(name string) *Value {
opChain := v.chain.enter("Alias(%q)", name)
defer opChain.leave()
v.chain.setAlias(name)
return v
}
// Path returns a new Value object for child object(s) matching given
// JSONPath expression.
//
// JSONPath is a simple XPath-like query language.
// See http://goessner.net/articles/JsonPath/.
//
// We currently use https://github.com/yalp/jsonpath, which implements
// only a subset of JSONPath, yet useful for simple queries. It doesn't
// support filters and requires double quotes for strings.
//
// Example 1:
//
// json := `{"users": [{"name": "john"}, {"name": "bob"}]}`
// value := NewValue(t, json)
//
// value.Path("$.users[0].name").String().IsEqual("john")
// value.Path("$.users[1].name").String().IsEqual("bob")
//
// Example 2:
//
// json := `{"yfGH2a": {"user": "john"}, "f7GsDd": {"user": "john"}}`
// value := NewValue(t, json)
//
// for _, user := range value.Path("$..user").Array().Iter() {
// user.String().IsEqual("john")
// }
func (v *Value) Path(path string) *Value {
opChain := v.chain.enter("Path(%q)", path)
defer opChain.leave()
return jsonPath(opChain, v.value, path)
}
// Schema succeeds if value matches given JSON Schema.
//
// JSON Schema specifies a JSON-based format to define the structure of
// JSON data. See http://json-schema.org/.
// We use https://github.com/xeipuuv/gojsonschema implementation.
//
// schema should be one of the following:
// - go value that can be json.Marshal-ed to a valid schema
// - type convertible to string containing valid schema
// - type convertible to string containing valid http:// or file:// URI,
// pointing to reachable and valid schema
//
// Example 1:
//
// schema := `{
// "type": "object",
// "properties": {
// "foo": {
// "type": "string"
// },
// "bar": {
// "type": "integer"
// }
// },
// "require": ["foo", "bar"]
// }`
//
// value := NewValue(t, map[string]interface{}{
// "foo": "a",
// "bar": 1,
// })
//
// value.Schema(schema)
//
// Example 2:
//
// value := NewValue(t, data)
// value.Schema("http://example.com/schema.json")
func (v *Value) Schema(schema interface{}) *Value {
opChain := v.chain.enter("Schema()")
defer opChain.leave()
jsonSchema(opChain, v.value, schema)
return v
}
// Object returns a new Object attached to underlying value.
//
// If underlying value is not an object (map[string]interface{}), failure is reported
// and empty (but non-nil) value is returned.
//
// Example:
//
// value := NewValue(t, map[string]interface{}{"foo": 123})
// value.Object().ContainsKey("foo")
func (v *Value) Object() *Object {
opChain := v.chain.enter("Object()")
defer opChain.leave()
if opChain.failed() {
return newObject(opChain, nil)
}
data, ok := v.value.(map[string]interface{})
if !ok {
opChain.fail(AssertionFailure{
Type: AssertValid,
Actual: &AssertionValue{v.value},
Errors: []error{
errors.New("expected: value is object"),
},
})
return newObject(opChain, nil)
}
return newObject(opChain, data)
}
// Array returns a new Array attached to underlying value.
//
// If underlying value is not an array ([]interface{}), failure is reported and empty
// (but non-nil) value is returned.
//
// Example:
//
// value := NewValue(t, []interface{}{"foo", 123})
// value.Array().ConsistsOf("foo", 123)
func (v *Value) Array() *Array {
opChain := v.chain.enter("Array()")
defer opChain.leave()
if opChain.failed() {
return newArray(opChain, nil)
}
data, ok := v.value.([]interface{})
if !ok {
opChain.fail(AssertionFailure{
Type: AssertValid,
Actual: &AssertionValue{v.value},
Errors: []error{
errors.New("expected: value is array"),
},
})
return newArray(opChain, nil)
}
return newArray(opChain, data)
}
// String returns a new String attached to underlying value.
//
// If underlying value is not a string, failure is reported and empty (but non-nil)
// value is returned.
//
// Example:
//
// value := NewValue(t, "foo")
// value.String().IsEqualFold("FOO")
func (v *Value) String() *String {
opChain := v.chain.enter("String()")
defer opChain.leave()
if opChain.failed() {
return newString(opChain, "")
}
data, ok := v.value.(string)
if !ok {
opChain.fail(AssertionFailure{
Type: AssertValid,
Actual: &AssertionValue{v.value},
Errors: []error{
errors.New("expected: value is string"),
},
})
return newString(opChain, "")
}
return newString(opChain, data)
}
// Number returns a new Number attached to underlying value.
//
// If underlying value is not a number (numeric type convertible to float64), failure
// is reported and empty (but non-nil) value is returned.
//
// Example:
//
// value := NewValue(t, 123)
// value.Number().InRange(100, 200)
func (v *Value) Number() *Number {
opChain := v.chain.enter("Number()")
defer opChain.leave()
if opChain.failed() {
return newNumber(opChain, 0)
}
data, ok := v.value.(float64)
if !ok {
opChain.fail(AssertionFailure{
Type: AssertValid,
Actual: &AssertionValue{v.value},
Errors: []error{
errors.New("expected: value is number"),
},
})
return newNumber(opChain, 0)
}
return newNumber(opChain, data)
}
// Boolean returns a new Boolean attached to underlying value.
//
// If underlying value is not a bool, failure is reported and empty (but non-nil)
// value is returned.
//
// Example:
//
// value := NewValue(t, true)
// value.Boolean().IsTrue()
func (v *Value) Boolean() *Boolean {
opChain := v.chain.enter("Boolean()")
defer opChain.leave()
if opChain.failed() {
return newBoolean(opChain, false)
}
data, ok := v.value.(bool)
if !ok {
opChain.fail(AssertionFailure{
Type: AssertValid,
Actual: &AssertionValue{v.value},
Errors: []error{
errors.New("expected: value is boolean"),
},
})
return newBoolean(opChain, false)
}
return newBoolean(opChain, data)
}
// IsNull succeeds if value is nil.
//
// Note that non-nil interface{} that points to nil value (e.g. nil slice or map)
// is also treated as null value. Empty (non-nil) slice or map, empty string, and
// zero number are not treated as null value.
//
// Example:
//
// value := NewValue(t, nil)
// value.IsNull()
//
// value := NewValue(t, []interface{}(nil))
// value.IsNull()
func (v *Value) IsNull() *Value {
opChain := v.chain.enter("IsNull()")
defer opChain.leave()
if opChain.failed() {
return v
}
if !(v.value == nil) {
opChain.fail(AssertionFailure{
Type: AssertNil,
Actual: &AssertionValue{v.value},
Errors: []error{
errors.New("expected: value is null"),
},
})
}
return v
}
// NotNull succeeds if value is not nil.
//
// Note that non-nil interface{} that points to nil value (e.g. nil slice or map)
// is also treated as null value. Empty (non-nil) slice or map, empty string, and
// zero number are not treated as null value.
//
// Example:
//
// value := NewValue(t, "")
// value.NotNull()
//
// value := NewValue(t, make([]interface{}, 0))
// value.NotNull()
func (v *Value) NotNull() *Value {
opChain := v.chain.enter("NotNull()")
defer opChain.leave()
if opChain.failed() {
return v
}
if v.value == nil {
opChain.fail(AssertionFailure{
Type: AssertNotNil,
Actual: &AssertionValue{v.value},
Errors: []error{
errors.New("expected: value is non-null"),
},
})
}
return v
}
// Deprecated: use IsNull instead.
func (v *Value) Null() *Value {
return v.IsNull()
}
// IsObject succeeds if the underlying value is an object.
//
// If underlying value is not an object (map[string]interface{}), failure is reported.
//
// Example:
//
// value := NewValue(t, map[string]interface{}{"foo": 123})
// value.IsObject()
func (v *Value) IsObject() *Value {
opChain := v.chain.enter("IsObject()")
defer opChain.leave()
if opChain.failed() {
return v
}
if _, ok := v.value.(map[string]interface{}); !ok {
opChain.fail(AssertionFailure{
Type: AssertValid,
Actual: &AssertionValue{v.value},
Errors: []error{
errors.New("expected: value is object"),
},
})
}
return v
}
// NotObject succeeds if the underlying value is not an object.
//
// If underlying value is an object (map[string]interface{}), failure is reported.
//
// Example:
//
// value := NewValue(t, nil)
// value.NotObject()
func (v *Value) NotObject() *Value {
opChain := v.chain.enter("NotObject()")
defer opChain.leave()
if opChain.failed() {
return v
}
if _, ok := v.value.(map[string]interface{}); ok {
opChain.fail(AssertionFailure{
Type: AssertValid,
Actual: &AssertionValue{v.value},
Errors: []error{
errors.New("expected: value is not object"),
},
})
}
return v
}
// IsArray succeeds if the underlying value is an array.
//
// If underlying value is not an array ([]interface{}), failure is reported.
//
// Example:
//
// value := NewValue(t, []interface{}{"foo", "123"})
// value.IsArray()
func (v *Value) IsArray() *Value {
opChain := v.chain.enter("IsArray()")
defer opChain.leave()
if opChain.failed() {
return v
}
if _, ok := v.value.([]interface{}); !ok {
opChain.fail(AssertionFailure{
Type: AssertValid,
Actual: &AssertionValue{v.value},
Errors: []error{
errors.New("expected: value is array"),
},
})
}
return v
}
// NotArray succeeds if the underlying value is not an array.
//
// If underlying value is an array ([]interface{}), failure is reported.
//
// Example:
//
// value := NewValue(t, nil)
// value.NotArray()
func (v *Value) NotArray() *Value {
opChain := v.chain.enter("NotArray()")
defer opChain.leave()
if opChain.failed() {
return v
}
if _, ok := v.value.([]interface{}); ok {
opChain.fail(AssertionFailure{
Type: AssertValid,
Actual: &AssertionValue{v.value},
Errors: []error{
errors.New("expected: value is not array"),
},
})
}
return v
}
// IsString succeeds if the underlying value is a string.
//
// If underlying value is not a string, failure is reported.
//
// Example:
//
// value := NewValue(t, "foo")
// value.IsString()
func (v *Value) IsString() *Value {
opChain := v.chain.enter("IsString()")
defer opChain.leave()
if opChain.failed() {
return v
}
if _, ok := v.value.(string); !ok {
opChain.fail(AssertionFailure{
Type: AssertValid,
Actual: &AssertionValue{v.value},
Errors: []error{
errors.New("expected: value is string"),
},
})
}
return v
}
// NotString succeeds if the underlying value is not a string.
//
// If underlying value is a string, failure is reported.
//
// Example:
//
// value := NewValue(t, nil)
// value.NotString()
func (v *Value) NotString() *Value {
opChain := v.chain.enter("NotString()")
defer opChain.leave()
if opChain.failed() {
return v
}
if _, ok := v.value.(string); ok {
opChain.fail(AssertionFailure{
Type: AssertValid,
Actual: &AssertionValue{v.value},
Errors: []error{
errors.New("expected: value is not string"),
},
})
}
return v
}
// IsNumber succeeds if the underlying value is a number.
//
// If underlying value is not a number (numeric type convertible to float64),
// failure is reported
//
// Example:
//
// value := NewValue(t, 123)
// value.IsNumber()
func (v *Value) IsNumber() *Value {
opChain := v.chain.enter("IsNumber()")
defer opChain.leave()
if opChain.failed() {
return v
}
if _, ok := v.value.(float64); !ok {
opChain.fail(AssertionFailure{
Type: AssertValid,
Actual: &AssertionValue{v.value},
Errors: []error{
errors.New("expected: value is number"),
},
})
}
return v
}
// NotNumber succeeds if the underlying value is a not a number.
//
// If underlying value is a number (numeric type convertible to float64),
// failure is reported
//
// Example:
//
// value := NewValue(t, nil)
// value.NotNumber()
func (v *Value) NotNumber() *Value {
opChain := v.chain.enter("NotNumber()")
defer opChain.leave()
if opChain.failed() {
return v
}
if _, ok := v.value.(float64); ok {
opChain.fail(AssertionFailure{
Type: AssertValid,
Actual: &AssertionValue{v.value},
Errors: []error{
errors.New("expected: value is not number"),
},
})
}
return v
}
// IsBoolean succeeds if the underlying value is a boolean.
//
// If underlying value is not a boolean, failure is reported.
//
// Example:
//
// value := NewValue(t, true)
// value.IsBoolean()
func (v *Value) IsBoolean() *Value {
opChain := v.chain.enter("IsBoolean()")
defer opChain.leave()
if opChain.failed() {
return v
}
if _, ok := v.value.(bool); !ok {
opChain.fail(AssertionFailure{
Type: AssertValid,
Actual: &AssertionValue{v.value},
Errors: []error{
errors.New("expected: value is boolean"),
},
})
}
return v
}
// NotBoolean succeeds if the underlying value is not a boolean.
//
// If underlying value is a boolean, failure is reported.
//
// Example:
//
// value := NewValue(t, nil)
// value.NotBoolean()
func (v *Value) NotBoolean() *Value {
opChain := v.chain.enter("NotBoolean()")
defer opChain.leave()
if opChain.failed() {
return v
}
if _, ok := v.value.(bool); ok {
opChain.fail(AssertionFailure{
Type: AssertValid,
Actual: &AssertionValue{v.value},
Errors: []error{
errors.New("expected: value is not boolean"),
},
})
}
return v
}
// IsEqual succeeds if value is equal to another value (e.g. map, slice, string, etc).
// Before comparison, both values are converted to canonical form.
//
// Example:
//
// value := NewValue(t, "foo")
// value.IsEqual("foo")
func (v *Value) IsEqual(value interface{}) *Value {
opChain := v.chain.enter("IsEqual()")
defer opChain.leave()
if opChain.failed() {
return v
}
expected, ok := canonValue(opChain, value)
if !ok {
return v
}
if !reflect.DeepEqual(expected, v.value) {
opChain.fail(AssertionFailure{
Type: AssertEqual,
Actual: &AssertionValue{v.value},
Expected: &AssertionValue{expected},
Errors: []error{
errors.New("expected: values are equal"),
},
})
}
return v
}
// NotEqual succeeds if value is not equal to another value (e.g. map, slice,
// string, etc). Before comparison, both values are converted to canonical form.
//
// Example:
//
// value := NewValue(t, "foo")
// value.NorEqual("bar")
func (v *Value) NotEqual(value interface{}) *Value {
opChain := v.chain.enter("NotEqual()")
defer opChain.leave()
if opChain.failed() {
return v
}
expected, ok := canonValue(opChain, value)
if !ok {
return v
}
if reflect.DeepEqual(expected, v.value) {
opChain.fail(AssertionFailure{
Type: AssertNotEqual,
Actual: &AssertionValue{v.value},
Expected: &AssertionValue{expected},
Errors: []error{
errors.New("expected: values are non-equal"),
},
})
}
return v
}
// Deprecated: use IsEqual instead.
func (v *Value) Equal(value interface{}) *Value {
return v.IsEqual(value)
}
// InList succeeds if whole value is equal to one of the values from given
// list of values (e.g. map, slice, string, etc). Before comparison, all
// values are converted to canonical form.
//
// If at least one value has wrong type, failure is reported.
//
// Example:
//
// value := NewValue(t, "foo")
// value.InList("foo", 123)
func (v *Value) InList(values ...interface{}) *Value {
opChain := v.chain.enter("InList()")
defer opChain.leave()
if opChain.failed() {
return v
}
if len(values) == 0 {
opChain.fail(AssertionFailure{
Type: AssertUsage,
Errors: []error{
errors.New("unexpected empty list argument"),
},
})
return v
}
var isListed bool
for _, val := range values {
expected, ok := canonValue(opChain, val)
if !ok {
return v
}
if reflect.DeepEqual(expected, v.value) {
isListed = true
// continue loop to check that all values are correct
}
}
if !isListed {
opChain.fail(AssertionFailure{
Type: AssertBelongs,
Actual: &AssertionValue{v.value},
Expected: &AssertionValue{AssertionList(values)},
Errors: []error{
errors.New("expected: value is equal to one of the values"),
},
})
}
return v
}
// NotInList succeeds if the whole value is not equal to any of the values from
// given list of values (e.g. map, slice, string, etc).
// Before comparison, all values are converted to canonical form.
//
// If at least one value has wrong type, failure is reported.
//
// Example:
//
// value := NewValue(t, "foo")
// value.NotInList("bar", 123)
func (v *Value) NotInList(values ...interface{}) *Value {
opChain := v.chain.enter("NotInList()")
defer opChain.leave()
if opChain.failed() {
return v
}
if len(values) == 0 {
opChain.fail(AssertionFailure{
Type: AssertUsage,
Errors: []error{
errors.New("unexpected empty list argument"),
},
})
return v
}
for _, val := range values {
expected, ok := canonValue(opChain, val)
if !ok {
return v
}
if reflect.DeepEqual(expected, v.value) {
opChain.fail(AssertionFailure{
Type: AssertNotBelongs,
Actual: &AssertionValue{v.value},
Expected: &AssertionValue{AssertionList(values)},
Errors: []error{
errors.New("expected: value is not equal to any of the values"),
},
})
return v
}
}
return v
}