summaryrefslogtreecommitdiff
path: root/tests/files/fail/test_type_none.yaml
blob: cc7c7dfc49974c10c6afdcacd0784228ba5d1b71 (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
#
# NOTE: This case is not allowed becuase Core class do NOT allow
#       there is no data to validate. This happens if None is at top level
#       of the data structure.
#
# ---
# name: type-none-1
# desc: Most basic test for type None
# data: ~
# schema:
#   type: none
---
name: fail-type-none-2
desc: Test that none type works with none type as value in map
data:
  name: 'abc'
schema:
  type: map
  mapping:
    name:
      type: none
errors:
  - "Value 'abc' is not of type 'none'. Path: '/name'"
---
name: fail-type-none-3
desc: Test that none type works as value in sequence
data:
  - 'abc'
  - 123
schema:
  type: seq
  sequence:
    - type: none
errors:
  - "Value '123' is not of type 'none'. Path: '/1'"
  - "Value 'abc' is not of type 'none'. Path: '/0'"
---
name: fail-type-none-4
desc: Test that none type works inside nested map, seq, map
data:
  foo:
    - bar: 'abc'
schema:
  type: map
  mapping:
    foo:
      type: seq
      sequence:
        - type: map
          mapping:
            bar:
              type: none
errors:
  - "Value 'abc' is not of type 'none'. Path: '/foo/0/bar'"