diff tests/schemata/test1.schema.yml @ 31:271ec3abdfa3

Use "$type" as the schema's type specifier instead of "type". THIS IS BACKWARDS INCOMPATIBLE.
author Franz Glasner <f.glasner@feldmann-mg.com>
date Tue, 18 Jul 2023 14:28:52 +0200
parents 41efa38a39b1
children
line wrap: on
line diff
--- a/tests/schemata/test1.schema.yml	Sat Jul 08 20:45:36 2023 +0200
+++ b/tests/schemata/test1.schema.yml	Tue Jul 18 14:28:52 2023 +0200
@@ -5,10 +5,10 @@
 %YAML 1.1
 ---
 
-type: dict
+$type: dict
 keys:
   string-value:
-    type: string
+    $type: string
     min-length: 1
     max-length: 255
     pattern:
@@ -17,111 +17,111 @@
         - &CALLABLE !!python/name:test_schema._test_generic_validator_for_yaml
 
   binary-value:
-    type: binary
+    $type: binary
     min-length: 20
     max-length: 256
     value: *CALLABLE
 
   int-value:
-    type: int
+    $type: int
     min-value: 0
     max-value: 100
     value: *CALLABLE
 
   float-value:
-    type: float
+    $type: float
     min-value: 0.0
     max-value: 50.0
     value: *CALLABLE
 
   numeric-value:
-    type: number
+    $type: number
     min-value: 0
     max-value: 1000
     value: *CALLABLE
 
   scalar-value:
-    type: scalar
+    $type: scalar
 
   bool-value:
-    type: bool
+    $type: bool
     value: *CALLABLE
 
   timestamp-value:
-    type: timestamp
+    $type: timestamp
     value: *CALLABLE
 
   null-value:
-    type: null
+    $type: null
 
   empty-value:
-    type: empty
+    $type: empty
 
   any-value:
-    type: accept
+    $type: accept
 
   not-any-value-allowed:
-    type: deny
+    $type: deny
 
   custom-value:
-    type: *CALLABLE
+    $type: *CALLABLE
 
   dict-value:
-    type: dict
+    $type: dict
     keys:
       key1:
-        type: accept
+        $type: accept
       0:
-        type: accept
+        $type: accept
       1:
-        type: accept
+        $type: accept
     key-names:
       one-of:
-        - type: string
-        - type: integer
+        - $type: string
+        - $type: integer
           min-value: 0
     additional-keys:
-      type: accept         # equivalent to the simpler: additional-keys: true
+      $type: accept         # equivalent to the simpler: additional-keys: true
     required:
       - key1
       - 0
 
   list-value:
-    type: list
+    $type: list
     min-length: 1
     max-length: 10
     items:
       any-of:
-        - type: scalar
-        - type: *CALLABLE
+        - $type: scalar
+        - $type: *CALLABLE
 
   record-value:
-    type: record
+    $type: record
     items:
-      - type: string
-      - type: number
+      - $type: string
+      - $type: number
     min-length: 2
     max-length: 2
     additional-items: false
 
   combinator-one-of:
     one-of:
-      - type: int
-      - type: float
-      - type: null
+      - $type: int
+      - $type: float
+      - $type: null
 
   combinator-all-of:
     all-of:
       - &NAME 
-        type:      string
+        $type:      string
         max-length: 255
         pattern: *NAMERE
-      - type: *CALLABLE
+      - $type: *CALLABLE
 
   combinator-any-of:
     any-of:
       - *NAME
-      - type: *CALLABLE
+      - $type: *CALLABLE
       - null
 
 additional-keys: false