Mercurial > hgrepos > Python > libs > data-schema
changeset 20:41efa38a39b1
FIX: example schema
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sat, 08 Jul 2023 10:06:02 +0200 |
| parents | c3a0fe8d4587 |
| children | e1c3a9e58574 |
| files | tests/schemata/test1.schema.yml |
| diffstat | 1 files changed, 31 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/schemata/test1.schema.yml Sat Jul 08 10:05:48 2023 +0200 +++ b/tests/schemata/test1.schema.yml Sat Jul 08 10:06:02 2023 +0200 @@ -1,6 +1,6 @@ # -*- coding: utf-8; mode: yaml; indent-tabs-mode: nil; -*- # -# This is an sample schema definition file with most feature +# This is an sample schema definition file with most features # %YAML 1.1 --- @@ -9,35 +9,35 @@ keys: string-value: type: string - minLength: 1 - maxLength: 255 + min-length: 1 + max-length: 255 pattern: - anyOf: + any-of: - &NAMERE !!python/object/apply:re.compile ['\A[A-Za-z_][A-Za-z0-9_]*\Z'] - &CALLABLE !!python/name:test_schema._test_generic_validator_for_yaml binary-value: type: binary - minLength: 20 - maxLength: 256 + min-length: 20 + max-length: 256 value: *CALLABLE int-value: type: int - minValue: 0 - maxValue: 100 + min-value: 0 + max-value: 100 value: *CALLABLE float-value: type: float - minValue: 0.0 - maxValue: 50.0 + min-value: 0.0 + max-value: 50.0 value: *CALLABLE numeric-value: type: number - minValue: 0 - maxValue: 1000 + min-value: 0 + max-value: 1000 value: *CALLABLE scalar-value: @@ -75,23 +75,23 @@ type: accept 1: type: accept - keyNames: - oneOf: + key-names: + one-of: - type: string - type: integer - minValue: 0 - additionalKeys: - type: accept # equivalent to the simpler: additionalKeys: true + min-value: 0 + additional-keys: + type: accept # equivalent to the simpler: additional-keys: true required: - key1 - 0 list-value: type: list - minLength: 1 - maxLength: 10 + min-length: 1 + max-length: 10 items: - anyOf: + any-of: - type: scalar - type: *CALLABLE @@ -100,29 +100,29 @@ items: - type: string - type: number - minLength: 2 - maxLength: 2 - additionalItems: false + min-length: 2 + max-length: 2 + additional-items: false - combinator-oneOf: - oneOf: + combinator-one-of: + one-of: - type: int - type: float - type: null - combinator-allOf: - allOf: + combinator-all-of: + all-of: - &NAME type: string - maxLength: 255 + max-length: 255 pattern: *NAMERE - type: *CALLABLE - combinator-anyOf: - anyOf: + combinator-any-of: + any-of: - *NAME - type: *CALLABLE - null -additionalKeys: false +additional-keys: false required: []
