summaryrefslogtreecommitdiff
path: root/tests/files/fail/test_type_str.yaml
blob: 13cdbb6acd581e20146279430f23b3c616783468 (plain)
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
---
name: fail-type-str-1
desc: Test simples str value
data: 1
schema:
  type: str
errors:
  - "Value '1' is not of type 'str'. Path: ''"
---
name: fail-type-str-2
desc: Test str value inside list
data:
  - 1
  - True
schema:
  type: seq
  sequence:
    - type: str
errors:
  - "Value '1' is not of type 'str'. Path: '/0'"
  - "Value 'True' is not of type 'str'. Path: '/1'"
---
name: fail-type-str-3
desc: Test str value in mapping
data:
    foo: 1
schema:
  type: map
  mapping:
    foo:
      type: str
errors:
  - "Value '1' is not of type 'str'. Path: '/foo'"
---
name: fail-type-str-4
desc: Test str inside nested map & seq
data:
  foo:
    - 1
schema:
  type: map
  mapping:
    foo:
      type: seq
      sequence:
        - type: str
errors:
  - "Value '1' is not of type 'str'. Path: '/foo/0'"
---
name: fail-deftype-1
desc: default type test
schema:
  type: seq
  sequence:
    - type: map
      mapping:
        "name":
        "email":
data:
  - name: 123
    email: true
  - name: 3.14
  - email: 2004-01-01
errors:
  - "Value '123' is not of type 'str'. Path: '/0/name'"
  - "Value '2004-01-01' is not of type 'str'. Path: '/2/email'"
  - "Value '3.14' is not of type 'str'. Path: '/1/name'"
  - "Value 'True' is not of type 'str'. Path: '/0/email'"
  ## Kwalify errors
  # :type_unmatch       : 1:3:[/0/name] '123': not a string.
  # :type_unmatch       : 2:3:[/0/email] 'true': not a string.
  # :type_unmatch       : 3:3:[/1/name] '3.14': not a string.
  # :type_unmatch       : 4:3:[/2/email] '2004-01-01': not a string.