dc-kwalify 0.7.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/contrib/kwalify +1 -1
- data/dc-kwalify.gemspec +27 -0
- data/lib/kwalify/main.rb +1 -1
- data/lib/kwalify/util/testcase-helper.rb +1 -1
- data/lib/kwalify/version.rb +5 -0
- data/lib/kwalify.rb +1 -7
- metadata +83 -203
- data/setup.rb +0 -1585
- data/test/Rookbook.yaml +0 -10
- data/test/data/users-guide/AddressBook.java.expected +0 -40
- data/test/data/users-guide/BABEL.data.yaml +0 -24
- data/test/data/users-guide/BABEL.schema.yaml +0 -30
- data/test/data/users-guide/ExampleAddressBook.java +0 -47
- data/test/data/users-guide/Group.java.expected +0 -24
- data/test/data/users-guide/Person.java.expected +0 -44
- data/test/data/users-guide/address_book.rb +0 -52
- data/test/data/users-guide/address_book.schema.yaml +0 -28
- data/test/data/users-guide/address_book.yaml +0 -27
- data/test/data/users-guide/answers-schema.yaml +0 -12
- data/test/data/users-guide/answers-validator.rb +0 -52
- data/test/data/users-guide/babel_genclass.result +0 -26
- data/test/data/users-guide/config.schema.yaml +0 -7
- data/test/data/users-guide/config.yaml +0 -4
- data/test/data/users-guide/document01a.yaml +0 -3
- data/test/data/users-guide/document01b.yaml +0 -3
- data/test/data/users-guide/document02a.yaml +0 -4
- data/test/data/users-guide/document02b.yaml +0 -4
- data/test/data/users-guide/document03a.yaml +0 -6
- data/test/data/users-guide/document03b.yaml +0 -6
- data/test/data/users-guide/document04a.yaml +0 -9
- data/test/data/users-guide/document04b.yaml +0 -9
- data/test/data/users-guide/document05a.yaml +0 -11
- data/test/data/users-guide/document05b.yaml +0 -12
- data/test/data/users-guide/document06a.yaml +0 -15
- data/test/data/users-guide/document06b.yaml +0 -16
- data/test/data/users-guide/document07a.yaml +0 -9
- data/test/data/users-guide/document07b.yaml +0 -7
- data/test/data/users-guide/document12a.json +0 -10
- data/test/data/users-guide/document12b.json +0 -6
- data/test/data/users-guide/document13a.yaml +0 -17
- data/test/data/users-guide/document14a.yaml +0 -3
- data/test/data/users-guide/document14b.yaml +0 -3
- data/test/data/users-guide/document15a.yaml +0 -6
- data/test/data/users-guide/document15b.yaml +0 -5
- data/test/data/users-guide/example_address_book.rb +0 -10
- data/test/data/users-guide/example_address_book_java.result +0 -32
- data/test/data/users-guide/example_address_book_ruby.result +0 -31
- data/test/data/users-guide/genclass_java.result +0 -4
- data/test/data/users-guide/howto-validation-with-parsing.rb +0 -28
- data/test/data/users-guide/howto-validation.rb +0 -25
- data/test/data/users-guide/howto3.rb +0 -6
- data/test/data/users-guide/howto3.result +0 -5
- data/test/data/users-guide/howto3.yaml +0 -8
- data/test/data/users-guide/howto5_databinding.result +0 -111
- data/test/data/users-guide/invalid01.result +0 -3
- data/test/data/users-guide/invalid02.result +0 -5
- data/test/data/users-guide/invalid03.result +0 -5
- data/test/data/users-guide/invalid04.result +0 -4
- data/test/data/users-guide/invalid05.result +0 -11
- data/test/data/users-guide/invalid06.result +0 -4
- data/test/data/users-guide/invalid07.result +0 -3
- data/test/data/users-guide/invalid08.result +0 -3
- data/test/data/users-guide/invalid12.json +0 -8
- data/test/data/users-guide/invalid14.result +0 -4
- data/test/data/users-guide/invalid15.result +0 -4
- data/test/data/users-guide/loadbabel.rb +0 -27
- data/test/data/users-guide/loadconfig.rb +0 -16
- data/test/data/users-guide/loadconfig.result +0 -6
- data/test/data/users-guide/models.rb +0 -22
- data/test/data/users-guide/option_ha.result +0 -6
- data/test/data/users-guide/option_ha_genclass_java.result +0 -7
- data/test/data/users-guide/schema01.yaml +0 -3
- data/test/data/users-guide/schema02.yaml +0 -12
- data/test/data/users-guide/schema03.yaml +0 -9
- data/test/data/users-guide/schema04.yaml +0 -20
- data/test/data/users-guide/schema05.yaml +0 -29
- data/test/data/users-guide/schema06.yaml +0 -11
- data/test/data/users-guide/schema12.json +0 -12
- data/test/data/users-guide/schema13.yaml +0 -13
- data/test/data/users-guide/schema14.yaml +0 -5
- data/test/data/users-guide/schema15.yaml +0 -21
- data/test/data/users-guide/valid01.result +0 -2
- data/test/data/users-guide/valid02.result +0 -2
- data/test/data/users-guide/valid03.result +0 -2
- data/test/data/users-guide/valid04.result +0 -2
- data/test/data/users-guide/valid05.result +0 -2
- data/test/data/users-guide/valid06.result +0 -2
- data/test/data/users-guide/valid07.result +0 -2
- data/test/data/users-guide/valid08.result +0 -2
- data/test/data/users-guide/valid12.result +0 -2
- data/test/data/users-guide/valid13.result +0 -2
- data/test/data/users-guide/valid14.result +0 -2
- data/test/data/users-guide/valid15.result +0 -2
- data/test/data/users-guide/validate08.rb +0 -37
- data/test/test-action.rb +0 -78
- data/test/test-action.yaml +0 -738
- data/test/test-databinding.rb +0 -83
- data/test/test-databinding.yaml +0 -339
- data/test/test-main.rb +0 -157
- data/test/test-main.yaml +0 -415
- data/test/test-metavalidator.rb +0 -80
- data/test/test-metavalidator.yaml +0 -1179
- data/test/test-parser-yaml.rb +0 -57
- data/test/test-parser-yaml.yaml +0 -1749
- data/test/test-rule.rb +0 -26
- data/test/test-rule.yaml +0 -317
- data/test/test-users-guide.rb +0 -75
- data/test/test-util.rb +0 -125
- data/test/test-validator.rb +0 -95
- data/test/test-validator.yaml +0 -986
- data/test/test-yaml-parser.rb +0 -47
- data/test/test-yaml-parser.yaml +0 -1226
- data/test/test.rb +0 -61
@@ -1,32 +0,0 @@
|
|
1
|
-
$ javac -classpath '.:kwalify.jar' *.java
|
2
|
-
$ java -classpath '.:kwalify.jar' ExampleAddressBook
|
3
|
-
group name: family
|
4
|
-
group desc: my family
|
5
|
-
|
6
|
-
group name: friend
|
7
|
-
group desc: my friends
|
8
|
-
|
9
|
-
group name: business
|
10
|
-
group desc: those who works together
|
11
|
-
|
12
|
-
person name: Sumire
|
13
|
-
person group: family
|
14
|
-
person email: null
|
15
|
-
person phone: null
|
16
|
-
person blood: A
|
17
|
-
person birth: Tue Feb 01 00:00:00 JST 2000
|
18
|
-
|
19
|
-
person name: Shiina
|
20
|
-
person group: friend
|
21
|
-
person email: shiina@mail.org
|
22
|
-
person phone: null
|
23
|
-
person blood: null
|
24
|
-
person birth: Wed Feb 01 00:00:00 JST 1995
|
25
|
-
|
26
|
-
person name: Sakura
|
27
|
-
person group: business
|
28
|
-
person email: cherry@mail.net
|
29
|
-
person phone: 012-345-6789
|
30
|
-
person blood: null
|
31
|
-
person birth: null
|
32
|
-
|
@@ -1,31 +0,0 @@
|
|
1
|
-
$ ruby example_address_book.rb
|
2
|
-
[#<Group:0xddf24 @desc="my family", @name="family">,
|
3
|
-
#<Group:0xddf10 @desc="my friends", @name="friend">,
|
4
|
-
#<Group:0xdde84 @desc="those who works together", @name="business">]
|
5
|
-
[#<Person:0xdefdc
|
6
|
-
@birth=#<Date: 4903089/2,0,2299161>,
|
7
|
-
@blood="A",
|
8
|
-
@deleted=false,
|
9
|
-
@desc=nil,
|
10
|
-
@email=nil,
|
11
|
-
@group="family",
|
12
|
-
@name="Sumire",
|
13
|
-
@phone=nil>,
|
14
|
-
#<Person:0xdee9c
|
15
|
-
@birth=#<Date: 4899437/2,0,2299161>,
|
16
|
-
@blood=nil,
|
17
|
-
@deleted=false,
|
18
|
-
@desc=nil,
|
19
|
-
@email="shiina@mail.org",
|
20
|
-
@group="friend",
|
21
|
-
@name="Shiina",
|
22
|
-
@phone=nil>,
|
23
|
-
#<Person:0xde8e8
|
24
|
-
@birth=nil,
|
25
|
-
@blood=nil,
|
26
|
-
@deleted=false,
|
27
|
-
@desc=nil,
|
28
|
-
@email="cherry@mail.net",
|
29
|
-
@group="business",
|
30
|
-
@name="Sakura",
|
31
|
-
@phone="012-345-6789">]
|
@@ -1,28 +0,0 @@
|
|
1
|
-
require 'kwalify'
|
2
|
-
#require 'yaml'
|
3
|
-
|
4
|
-
## load schema data
|
5
|
-
schema = Kwalify::Yaml.load_file('schema.yaml')
|
6
|
-
## or
|
7
|
-
#schema = YAML.load_file('schema.yaml')
|
8
|
-
|
9
|
-
## create validator
|
10
|
-
validator = Kwalify::Validator.new(schema)
|
11
|
-
|
12
|
-
## create parser with validator
|
13
|
-
## (if validator is ommitted, no validation executed.)
|
14
|
-
parser = Kwalify:::Yaml::Parser.new(validator)
|
15
|
-
|
16
|
-
## parse document with validation
|
17
|
-
filename = 'document.yaml'
|
18
|
-
document = parser.parse_file(filename)
|
19
|
-
## or
|
20
|
-
#document = parser.parse(File.read(filename), filename)
|
21
|
-
|
22
|
-
## show errors if exist
|
23
|
-
errors = parser.errors()
|
24
|
-
if errors && !errors.empty?
|
25
|
-
for e in errors
|
26
|
-
puts "#{e.linenum}:#{e.column} [#{e.path}] #{e.message}"
|
27
|
-
end
|
28
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'kwalify'
|
2
|
-
#require 'yaml'
|
3
|
-
|
4
|
-
## load schema data
|
5
|
-
schema = Kwalify::Yaml.load_file('schema.yaml')
|
6
|
-
## or
|
7
|
-
#schema = YAML.load_file('schema.yaml')
|
8
|
-
|
9
|
-
## create validator
|
10
|
-
validator = Kwalify::Validator.new(schema)
|
11
|
-
|
12
|
-
## load document
|
13
|
-
document = Kwalify::Yaml.load_file('document.yaml')
|
14
|
-
## or
|
15
|
-
#document = YAML.load_file('document.yaml')
|
16
|
-
|
17
|
-
## validate
|
18
|
-
errors = validator.validate(document)
|
19
|
-
|
20
|
-
## show errors
|
21
|
-
if errors && !errors.empty?
|
22
|
-
for e in errors
|
23
|
-
puts "[#{e.path}] #{e.message}"
|
24
|
-
end
|
25
|
-
end
|
@@ -1,111 +0,0 @@
|
|
1
|
-
$ ruby loadbabel.rb
|
2
|
-
{"teams"=>
|
3
|
-
[#<Babel::Team:0x53e0f8
|
4
|
-
@chief=
|
5
|
-
#<Babel::Member:0x53d5e0
|
6
|
-
@desc="Scientist",
|
7
|
-
@name="Kohichi Minamoto",
|
8
|
-
@team=#<Babel::Team:0x53e0f8 ...>>,
|
9
|
-
@desc="Level 7 ESPers",
|
10
|
-
@members=
|
11
|
-
[#<Babel::Member:0x53d018
|
12
|
-
@desc="Psychokino",
|
13
|
-
@name="Kaoru Akashi",
|
14
|
-
@team=#<Babel::Team:0x53e0f8 ...>>,
|
15
|
-
#<Babel::Member:0x53ca50
|
16
|
-
@desc="Teleporter",
|
17
|
-
@name="Aoi Nogami",
|
18
|
-
@team=#<Babel::Team:0x53e0f8 ...>>,
|
19
|
-
#<Babel::Member:0x53c488
|
20
|
-
@desc="Psycometrer",
|
21
|
-
@name="Shiho Sannomiya",
|
22
|
-
@team=#<Babel::Team:0x53e0f8 ...>>],
|
23
|
-
@name="The Children">],
|
24
|
-
"members"=>
|
25
|
-
[#<Babel::Member:0x53d5e0
|
26
|
-
@desc="Scientist",
|
27
|
-
@name="Kohichi Minamoto",
|
28
|
-
@team=
|
29
|
-
#<Babel::Team:0x53e0f8
|
30
|
-
@chief=#<Babel::Member:0x53d5e0 ...>,
|
31
|
-
@desc="Level 7 ESPers",
|
32
|
-
@members=
|
33
|
-
[#<Babel::Member:0x53d018
|
34
|
-
@desc="Psychokino",
|
35
|
-
@name="Kaoru Akashi",
|
36
|
-
@team=#<Babel::Team:0x53e0f8 ...>>,
|
37
|
-
#<Babel::Member:0x53ca50
|
38
|
-
@desc="Teleporter",
|
39
|
-
@name="Aoi Nogami",
|
40
|
-
@team=#<Babel::Team:0x53e0f8 ...>>,
|
41
|
-
#<Babel::Member:0x53c488
|
42
|
-
@desc="Psycometrer",
|
43
|
-
@name="Shiho Sannomiya",
|
44
|
-
@team=#<Babel::Team:0x53e0f8 ...>>],
|
45
|
-
@name="The Children">>,
|
46
|
-
#<Babel::Member:0x53d018
|
47
|
-
@desc="Psychokino",
|
48
|
-
@name="Kaoru Akashi",
|
49
|
-
@team=
|
50
|
-
#<Babel::Team:0x53e0f8
|
51
|
-
@chief=
|
52
|
-
#<Babel::Member:0x53d5e0
|
53
|
-
@desc="Scientist",
|
54
|
-
@name="Kohichi Minamoto",
|
55
|
-
@team=#<Babel::Team:0x53e0f8 ...>>,
|
56
|
-
@desc="Level 7 ESPers",
|
57
|
-
@members=
|
58
|
-
[#<Babel::Member:0x53d018 ...>,
|
59
|
-
#<Babel::Member:0x53ca50
|
60
|
-
@desc="Teleporter",
|
61
|
-
@name="Aoi Nogami",
|
62
|
-
@team=#<Babel::Team:0x53e0f8 ...>>,
|
63
|
-
#<Babel::Member:0x53c488
|
64
|
-
@desc="Psycometrer",
|
65
|
-
@name="Shiho Sannomiya",
|
66
|
-
@team=#<Babel::Team:0x53e0f8 ...>>],
|
67
|
-
@name="The Children">>,
|
68
|
-
#<Babel::Member:0x53ca50
|
69
|
-
@desc="Teleporter",
|
70
|
-
@name="Aoi Nogami",
|
71
|
-
@team=
|
72
|
-
#<Babel::Team:0x53e0f8
|
73
|
-
@chief=
|
74
|
-
#<Babel::Member:0x53d5e0
|
75
|
-
@desc="Scientist",
|
76
|
-
@name="Kohichi Minamoto",
|
77
|
-
@team=#<Babel::Team:0x53e0f8 ...>>,
|
78
|
-
@desc="Level 7 ESPers",
|
79
|
-
@members=
|
80
|
-
[#<Babel::Member:0x53d018
|
81
|
-
@desc="Psychokino",
|
82
|
-
@name="Kaoru Akashi",
|
83
|
-
@team=#<Babel::Team:0x53e0f8 ...>>,
|
84
|
-
#<Babel::Member:0x53ca50 ...>,
|
85
|
-
#<Babel::Member:0x53c488
|
86
|
-
@desc="Psycometrer",
|
87
|
-
@name="Shiho Sannomiya",
|
88
|
-
@team=#<Babel::Team:0x53e0f8 ...>>],
|
89
|
-
@name="The Children">>,
|
90
|
-
#<Babel::Member:0x53c488
|
91
|
-
@desc="Psycometrer",
|
92
|
-
@name="Shiho Sannomiya",
|
93
|
-
@team=
|
94
|
-
#<Babel::Team:0x53e0f8
|
95
|
-
@chief=
|
96
|
-
#<Babel::Member:0x53d5e0
|
97
|
-
@desc="Scientist",
|
98
|
-
@name="Kohichi Minamoto",
|
99
|
-
@team=#<Babel::Team:0x53e0f8 ...>>,
|
100
|
-
@desc="Level 7 ESPers",
|
101
|
-
@members=
|
102
|
-
[#<Babel::Member:0x53d018
|
103
|
-
@desc="Psychokino",
|
104
|
-
@name="Kaoru Akashi",
|
105
|
-
@team=#<Babel::Team:0x53e0f8 ...>>,
|
106
|
-
#<Babel::Member:0x53ca50
|
107
|
-
@desc="Teleporter",
|
108
|
-
@name="Aoi Nogami",
|
109
|
-
@team=#<Babel::Team:0x53e0f8 ...>>,
|
110
|
-
#<Babel::Member:0x53c488 ...>],
|
111
|
-
@name="The Children">>]}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
$ kwalify -lf schema05.yaml document05b.yaml
|
2
|
-
document05b.yaml#0: INVALID
|
3
|
-
- (line 2) [/0/email] 'foo(at)mail.com': not matched to pattern /@/.
|
4
|
-
- (line 3) [/0/password] 'xxx123': too short (length 6 < min 8).
|
5
|
-
- (line 4) [/0/age] 'twenty': not a integer.
|
6
|
-
- (line 5) [/0/blood] 'a': invalid blood value.
|
7
|
-
- (line 7) [/1] key 'name:' is required.
|
8
|
-
- (line 7) [/1/given-name] key 'given-name:' is undefined.
|
9
|
-
- (line 8) [/1/family-name] key 'family-name:' is undefined.
|
10
|
-
- (line 10) [/1/age] '15': too small (< min 18).
|
11
|
-
- (line 12) [/1/birth] '1980/01/01': not a date.
|
@@ -1,8 +0,0 @@
|
|
1
|
-
$ kwalify -lf schema12.json document12b.json
|
2
|
-
document12b.json#0: INVALID
|
3
|
-
- (line 1) [/] key 'name:' is required.
|
4
|
-
- (line 2) [/mail] key 'mail:' is undefined.
|
5
|
-
- (line 3) [/age] 'twenty': not a integer.
|
6
|
-
- (line 4) [/gender] 'X': invalid gender value.
|
7
|
-
- (line 5) [/favorite/0] '123': not a string.
|
8
|
-
- (line 5) [/favorite/1] '456': not a string.
|
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'kwalify'
|
2
|
-
require 'models'
|
3
|
-
|
4
|
-
## load schema definition
|
5
|
-
schema = Kwalify::Yaml.load_file('BABEL.schema.yaml',
|
6
|
-
:untabify=>true,
|
7
|
-
:preceding_alias=>true)
|
8
|
-
|
9
|
-
## add module name to 'class:'
|
10
|
-
Kwalify::Util.traverse_schema(schema) do |rulehash|
|
11
|
-
if rulehash['class']
|
12
|
-
rulehash['class'] = 'Babel::' + rulehash['class']
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
## create validator
|
17
|
-
validator = Kwalify::Validator.new(schema)
|
18
|
-
|
19
|
-
## parse with data-binding
|
20
|
-
parser = Kwalify::Yaml::Parser.new(validator)
|
21
|
-
parser.preceding_alias = true
|
22
|
-
parser.data_binding = true
|
23
|
-
ydoc = parser.parse_file('BABEL.data.yaml', :untabify=>true)
|
24
|
-
|
25
|
-
## show document
|
26
|
-
require 'pp'
|
27
|
-
pp ydoc
|
@@ -1,16 +0,0 @@
|
|
1
|
-
## class definition
|
2
|
-
require 'kwalify/util/hashlike'
|
3
|
-
class Config
|
4
|
-
include Kwalify::Util::HashLike # defines [], []=, and keys?
|
5
|
-
attr_accessor :host, :posrt, :user, :pass
|
6
|
-
end
|
7
|
-
## create validator object
|
8
|
-
require 'kwalify'
|
9
|
-
schema = Kwalify::Yaml.load_file('config.schema.yaml')
|
10
|
-
validator = Kwalify::Validator.new(schema)
|
11
|
-
## parse configuration file with data binding
|
12
|
-
parser = Kwalify::Yaml::Parser.new(validator)
|
13
|
-
parser.data_binding = true # enable data binding
|
14
|
-
config = parser.parse_file('config.yaml')
|
15
|
-
require 'pp'
|
16
|
-
pp config
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'kwalify/util/hashlike'
|
2
|
-
|
3
|
-
module Babel
|
4
|
-
|
5
|
-
##
|
6
|
-
class Team
|
7
|
-
include Kwalify::Util::HashLike
|
8
|
-
attr_accessor :name # str
|
9
|
-
attr_accessor :desc # str
|
10
|
-
attr_accessor :chief # map
|
11
|
-
attr_accessor :members # seq
|
12
|
-
end
|
13
|
-
|
14
|
-
##
|
15
|
-
class Member
|
16
|
-
include Kwalify::Util::HashLike
|
17
|
-
attr_accessor :name # str
|
18
|
-
attr_accessor :desc # str
|
19
|
-
attr_accessor :team # map
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
@@ -1,6 +0,0 @@
|
|
1
|
-
$ kwalify -ha genclass-ruby
|
2
|
-
--module=name : module name in which class defined
|
3
|
-
--parent=name : parent class name
|
4
|
-
--include=name : module name which all classes include
|
5
|
-
--initialize=false : not print initialize() method
|
6
|
-
--hashlike : include Kwalify::Util::HashLike module
|
@@ -1,7 +0,0 @@
|
|
1
|
-
$ kwalify -ha genclass-java
|
2
|
-
--package=name : package name
|
3
|
-
--extends=name : class name to extend
|
4
|
-
--implements=name,... : interface names to implement
|
5
|
-
--dir=path : directory to locate output file
|
6
|
-
--basedir=path : base directory to locate output file
|
7
|
-
--constructor=false : not print initialize() method
|
@@ -1,20 +0,0 @@
|
|
1
|
-
type: map
|
2
|
-
mapping:
|
3
|
-
"company":
|
4
|
-
type: str
|
5
|
-
required: yes
|
6
|
-
"email":
|
7
|
-
type: str
|
8
|
-
"employees":
|
9
|
-
type: seq
|
10
|
-
sequence:
|
11
|
-
- type: map
|
12
|
-
mapping:
|
13
|
-
"code":
|
14
|
-
type: int
|
15
|
-
required: yes
|
16
|
-
"name":
|
17
|
-
type: str
|
18
|
-
required: yes
|
19
|
-
"email":
|
20
|
-
type: str
|
@@ -1,29 +0,0 @@
|
|
1
|
-
type: seq
|
2
|
-
sequence:
|
3
|
-
-
|
4
|
-
type: map
|
5
|
-
mapping:
|
6
|
-
"name":
|
7
|
-
type: str
|
8
|
-
required: yes
|
9
|
-
"email":
|
10
|
-
type: str
|
11
|
-
required: yes
|
12
|
-
pattern: /@/
|
13
|
-
"password":
|
14
|
-
type: text
|
15
|
-
length: { max: 16, min: 8 }
|
16
|
-
"age":
|
17
|
-
type: int
|
18
|
-
range: { max: 30, min: 18 }
|
19
|
-
# or assert: 18 <= val && val <= 30
|
20
|
-
"blood":
|
21
|
-
type: str
|
22
|
-
enum: [A, B, O, AB]
|
23
|
-
"birth":
|
24
|
-
type: date
|
25
|
-
"memo":
|
26
|
-
type: any
|
27
|
-
"deleted":
|
28
|
-
type: bool
|
29
|
-
default: false
|
@@ -1,12 +0,0 @@
|
|
1
|
-
{ "type": "map",
|
2
|
-
"required": true,
|
3
|
-
"mapping": {
|
4
|
-
"name": { "type": "str", "required": true },
|
5
|
-
"email": { "type": "str" },
|
6
|
-
"age": { "type": "int" },
|
7
|
-
"gender": { "type": "str", "enum": ["M", "F"] },
|
8
|
-
"favorite": { "type": "seq",
|
9
|
-
"sequence": [ { "type": "str" } ]
|
10
|
-
}
|
11
|
-
}
|
12
|
-
}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
type: map
|
2
|
-
mapping:
|
3
|
-
"group":
|
4
|
-
type: map
|
5
|
-
mapping:
|
6
|
-
"name": &name
|
7
|
-
type: str
|
8
|
-
required: yes
|
9
|
-
"email": &email
|
10
|
-
type: str
|
11
|
-
pattern: /@/
|
12
|
-
required: no
|
13
|
-
"user":
|
14
|
-
type: map
|
15
|
-
mapping:
|
16
|
-
"name":
|
17
|
-
<<: *name # merge
|
18
|
-
length: { max: 16 } # add
|
19
|
-
"email":
|
20
|
-
<<: *email # merge
|
21
|
-
required: yes # override
|