Project | Branch | Lines +/- | Subject | |
---|---|---|---|---|
mediawiki/services/function-orchestrator | master | +1 K -131 | Provide Bespoke Validation for All Built-In Types in Normal Form |
Details
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | arthurlorenzi | T281756 Provide Bespoke Validation for All Built-In Types in Normal Form | |||
Resolved | arthurlorenzi | T283183 Update Schemata for Validation of Core Types |
Event Timeline
It should all follow from https://meta.wikimedia.org/wiki/Special:MyLanguage/Abstract_Wikipedia/Function_model and https://meta.wikimedia.org/wiki/Abstract_Wikipedia/Pre-generic_function_model but I am pretty sure it does not. If helpful, ping me and I will provide a more specific list of conditions.
The built-in types are all the types between Z1 and Z99. Their respective validators are their ZID + 100, so the validator for Z14 is at Z114. The builtin implementation for that validator is at another +100, i.e. the builtin implementation for Z114 is at Z214.
Here are a few examples of validations:
- Z10 must either have both keys, or none.
- Z12 should have only one value for each language in its Z12K1
- Z14 must have a Z14K1, and either a Z14K2, a Z14K3 or a Z14K4 (but only one of these, and not more than one)
There should be a generic validator (Z101) that checks:
- whether all the keys on the object are defined on its Type
- whether all the values for all the keys of the object resolve to the expected type defined for that key
- calls the validator for all values for all the keys of the object recursively
A validator can choose to call the generic validator or not. For example, the validators for Z7 and Z99 will not call the generic validator, as they wouldn't pass.
Change 694711 had a related patch set uploaded (by Arthur Lorenzi; author: Arthur Lorenzi):
[mediawiki/services/function-orchestrator@master] Provide Bespoke Validation for All Built-In Types in Normal Form
Change 694711 merged by jenkins-bot:
[mediawiki/services/function-orchestrator@master] Provide Bespoke Validation for All Built-In Types in Normal Form