Mercurial > hgrepos > Python > libs > data-schema
comparison tests/schemata/test1.schema.yml @ 20:41efa38a39b1
FIX: example schema
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sat, 08 Jul 2023 10:06:02 +0200 |
| parents | 84dfd1a94926 |
| children | 271ec3abdfa3 |
comparison
equal
deleted
inserted
replaced
| 19:c3a0fe8d4587 | 20:41efa38a39b1 |
|---|---|
| 1 # -*- coding: utf-8; mode: yaml; indent-tabs-mode: nil; -*- | 1 # -*- coding: utf-8; mode: yaml; indent-tabs-mode: nil; -*- |
| 2 # | 2 # |
| 3 # This is an sample schema definition file with most feature | 3 # This is an sample schema definition file with most features |
| 4 # | 4 # |
| 5 %YAML 1.1 | 5 %YAML 1.1 |
| 6 --- | 6 --- |
| 7 | 7 |
| 8 type: dict | 8 type: dict |
| 9 keys: | 9 keys: |
| 10 string-value: | 10 string-value: |
| 11 type: string | 11 type: string |
| 12 minLength: 1 | 12 min-length: 1 |
| 13 maxLength: 255 | 13 max-length: 255 |
| 14 pattern: | 14 pattern: |
| 15 anyOf: | 15 any-of: |
| 16 - &NAMERE !!python/object/apply:re.compile ['\A[A-Za-z_][A-Za-z0-9_]*\Z'] | 16 - &NAMERE !!python/object/apply:re.compile ['\A[A-Za-z_][A-Za-z0-9_]*\Z'] |
| 17 - &CALLABLE !!python/name:test_schema._test_generic_validator_for_yaml | 17 - &CALLABLE !!python/name:test_schema._test_generic_validator_for_yaml |
| 18 | 18 |
| 19 binary-value: | 19 binary-value: |
| 20 type: binary | 20 type: binary |
| 21 minLength: 20 | 21 min-length: 20 |
| 22 maxLength: 256 | 22 max-length: 256 |
| 23 value: *CALLABLE | 23 value: *CALLABLE |
| 24 | 24 |
| 25 int-value: | 25 int-value: |
| 26 type: int | 26 type: int |
| 27 minValue: 0 | 27 min-value: 0 |
| 28 maxValue: 100 | 28 max-value: 100 |
| 29 value: *CALLABLE | 29 value: *CALLABLE |
| 30 | 30 |
| 31 float-value: | 31 float-value: |
| 32 type: float | 32 type: float |
| 33 minValue: 0.0 | 33 min-value: 0.0 |
| 34 maxValue: 50.0 | 34 max-value: 50.0 |
| 35 value: *CALLABLE | 35 value: *CALLABLE |
| 36 | 36 |
| 37 numeric-value: | 37 numeric-value: |
| 38 type: number | 38 type: number |
| 39 minValue: 0 | 39 min-value: 0 |
| 40 maxValue: 1000 | 40 max-value: 1000 |
| 41 value: *CALLABLE | 41 value: *CALLABLE |
| 42 | 42 |
| 43 scalar-value: | 43 scalar-value: |
| 44 type: scalar | 44 type: scalar |
| 45 | 45 |
| 73 type: accept | 73 type: accept |
| 74 0: | 74 0: |
| 75 type: accept | 75 type: accept |
| 76 1: | 76 1: |
| 77 type: accept | 77 type: accept |
| 78 keyNames: | 78 key-names: |
| 79 oneOf: | 79 one-of: |
| 80 - type: string | 80 - type: string |
| 81 - type: integer | 81 - type: integer |
| 82 minValue: 0 | 82 min-value: 0 |
| 83 additionalKeys: | 83 additional-keys: |
| 84 type: accept # equivalent to the simpler: additionalKeys: true | 84 type: accept # equivalent to the simpler: additional-keys: true |
| 85 required: | 85 required: |
| 86 - key1 | 86 - key1 |
| 87 - 0 | 87 - 0 |
| 88 | 88 |
| 89 list-value: | 89 list-value: |
| 90 type: list | 90 type: list |
| 91 minLength: 1 | 91 min-length: 1 |
| 92 maxLength: 10 | 92 max-length: 10 |
| 93 items: | 93 items: |
| 94 anyOf: | 94 any-of: |
| 95 - type: scalar | 95 - type: scalar |
| 96 - type: *CALLABLE | 96 - type: *CALLABLE |
| 97 | 97 |
| 98 record-value: | 98 record-value: |
| 99 type: record | 99 type: record |
| 100 items: | 100 items: |
| 101 - type: string | 101 - type: string |
| 102 - type: number | 102 - type: number |
| 103 minLength: 2 | 103 min-length: 2 |
| 104 maxLength: 2 | 104 max-length: 2 |
| 105 additionalItems: false | 105 additional-items: false |
| 106 | 106 |
| 107 combinator-oneOf: | 107 combinator-one-of: |
| 108 oneOf: | 108 one-of: |
| 109 - type: int | 109 - type: int |
| 110 - type: float | 110 - type: float |
| 111 - type: null | 111 - type: null |
| 112 | 112 |
| 113 combinator-allOf: | 113 combinator-all-of: |
| 114 allOf: | 114 all-of: |
| 115 - &NAME | 115 - &NAME |
| 116 type: string | 116 type: string |
| 117 maxLength: 255 | 117 max-length: 255 |
| 118 pattern: *NAMERE | 118 pattern: *NAMERE |
| 119 - type: *CALLABLE | 119 - type: *CALLABLE |
| 120 | 120 |
| 121 combinator-anyOf: | 121 combinator-any-of: |
| 122 anyOf: | 122 any-of: |
| 123 - *NAME | 123 - *NAME |
| 124 - type: *CALLABLE | 124 - type: *CALLABLE |
| 125 - null | 125 - null |
| 126 | 126 |
| 127 additionalKeys: false | 127 additional-keys: false |
| 128 required: [] | 128 required: [] |
