Abstract Wikipedia/Validation of core types
This page is currently a draft. More information pertaining to this may be available on the talk page. Translation admins: Normally, drafts should not be marked for translation. |
This is the state for the pre-generic function model.
Z1/Object edit
- This is the standard checker which is called by most of the other validators
- Checks that the schemata is being followed (this should cover the following points)
- the type Z1 is forbidden on Z1K1
- (Condition 1) All keys used on the instance are defined on the type
- (Condition 2) All required keys are used on the instance
- (Condition 3) The types of the values are compatible with the declared types for the respective keys (compatible means that the value is either of the type given or a reference or a function call) - if we can look into other objects, ensure the reference has the correct type or the function call returns either the correct type or Z1
- (Condition 4) All values on the keys are checked recursively and validation errors on those are propagated
Z2/Persistent object edit
- Use the standard checker of Z1
- Ensure that the value of Z2K2 is not of type Z1, Z2, Z3, Z9, Z17, Z18, Z39
Z3/Key edit
- Use the standard checker of Z1
- ensure the syntax of the Z3K2/key is is ZnKn
Z4/Type edit
- Use the standard checker of Z1
- Ensure all Z3K2/key ids of all Z4K2/keys are unique
- Ensure all Z3K2/key ids of all Z4K2/keys are consecutive and start with ZnK1
- Ensure all Z3K2/key ids of all Z4K2/keys start with the Z4K1/identity
- ensure the Z8K2/return type of the function on Z4K3/validator is Z10/List
Z5/Error edit
- Use the standard checker of Z1
- Ensure the type of the value of Z5K2 is the type given in Z5K1
Z6/String edit
- Use the standard checker of Z1
- the Z6K1 must be a JSON string and not a reference or function call or another object
Z7/Function call edit
- Do not use the standard checker of Z1
- the keys must be Z1K1, Z7K1, and the keys of the arguments defined on the function given in the Z7K1, and nothing else
- the type of Z7K1 must be a function
- the type of the arguments must be compatible with the type defined on the argument declaration
- Add general condition 4
Z8/Function edit
- Use the standard checker of Z1
- Ensure all Z17K2/key ids of all Z8K1/arguments are unique
- Ensure all Z17K2/key ids of all Z8K1/arguments are consecutive and start with ZnK1
- Ensure all Z17K2/key ids of all Z8K1/arguments start with the Z8K5/identity
Z9/Reference edit
- Use the standard checker of Z1
- the Z9K1 must be a JSON string and not a reference or function call or another object
- the Z9K1 string must be of the form Zn
Z10/List edit
- Either the only key is Z1K1, or use the standard checker of Z1
Z11/Monolingual text edit
- Use the standard checker of Z1
Z12/Multilingual text edit
- Use the standard checker of Z1
- each Z11K1/language on all Z12K1/texts appears only once
Z14/Implementation edit
- Use only condition 1, 3, and 4 of the standard checker of Z1
- require Z14K1
- require one, and exactly one of Z14K2, Z14K3, or Z14K4
Z16/Code edit
- Use the standard checker of Z1
Z17/Argument declaration edit
- Use the standard checker of Z1
- ensure the syntax of the Z17K2/key is ZnKn
Z18/Argument reference edit
- Use the standard checker of Z1
- ensure the syntax of the Z18K1/key id is ZnKn
Z20/Tester edit
- Use the standard checker of Z1
- ensure the Z8K2/return type of the function on Z20K2/result validation is Z40/Boolean
Z21/Unit edit
- Use the standard checker of Z1
Z22/Pair edit
- Use the standard checker of Z1
Z23/Nothing edit
- always fail (no instances of Nothing are allowed), i.e. just return an error that no instances of Nothing are allowed
Z40/Boolean edit
- Use the standard checker of Z1
- the value of Z40K1/identity must be either Z41 or Z42
Z50/Error type edit
- Use the standard checker of Z1
- Ensure all Z3K2/key ids of all Z50K1/keys are unique
- Ensure all Z3K2/key ids of all Z8K1/arguments are consecutive and start with ZnK1
- Ensure all Z3K2/key ids of all Z8K1/arguments start with the Z8K5/identity
Z60/Language edit
- Use the standard checker of Z1
- check if Z60K1 is a valid language code (? Maybe skip that, maybe make its own task) - i.e. check if it is of the form 2 or 3 letters, potentially followed by a dash and region code (i.e. 2 letters), potentially followed by a script identifier (i.e. a dash and then four letters)
Z61/Programming language edit
- Use the standard checker of Z1
- ensure the Z61K1 is just letters and dashes
Z80/Byte edit
- Use the standard checker of Z1
- ensure Z80K1 has exactly two characters, both in 0..9A..F
Z86/Character edit
- Use the standard checker of Z1
- ensure the length of Z86K1 is 1
Z99/Quote edit
- Do not use the standard checker of Z1 (the idea of the quote is that the quote value can be erroneous)
- do check that the only two keys are a Z1K1 and a Z99K1 and that both are there. Do not check the value of Z99K1 recursively.