diff options
Diffstat (limited to 'examples/kwalify-2.pp')
-rw-r--r-- | examples/kwalify-2.pp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/kwalify-2.pp b/examples/kwalify-2.pp new file mode 100644 index 0000000..3f4ec33 --- /dev/null +++ b/examples/kwalify-2.pp @@ -0,0 +1,24 @@ +$schema = { + 'type' => 'map', + 'mapping' => { + 'name' => { + 'type' => 'str', + 'required' => true, + }, + 'email' => { + 'type' => 'str', + 'pattern' => '/@/', + }, + 'age' => { + 'type' => 'str', + 'pattern' => '/^\d+$/', + }, + } +} +$document = { + 'name' => 'foo', + 'email' => 'foo@mail.com', + 'age' => 20, +} + +kwalify($schema, $document) |