There are currently five rules to define constraints on container objects that are either sequences or mappings:
items defines a sequence of individual sets of rules for each item in a sequence
keyschema defines one set of rules that all keys of a mapping must match
schema
- either defines a schema for a subdocument (a mapping) with the same (slightly enhanced, actually) semantics as a 'top level' schema
- or it defines one set of rules that all items in a sequence must match
valueschema defines one set of rules that all values of a mapping must match
Proposal 1
the different meanings of schema have been a source of confusion among users and it also forces us to operate with some assumptions in the code and to add some necessary overhead around this.
therefore the next major relase should clarify semantics on the schema rule. it's quiet obvious that its name points to the first mentioned mapping-related semantic as it matches the overall usage of the term schema in Cerberus' nomenclature.
the name of the other rule should be chosen wisely to imply both the similarity with and the difference to the items rule.
i can think of the following atm:
allitems (see rationale in P2)
eachitem (see rationale in P2)
itemsrules
Proposal 2
as the comprehension above shows, there are two categories of rules in this realm: those that define a set of rules for particular items or just any item of a container object and those that define a schema that assigns such set of rules to values identified by a key. it'd be therefore terminologically stringent to rename keyschema and valueschema to keysrules and valuesrules. as there are no name conflicts, the previous names can still be used as aliases.
with these terms, itemsrules would be a consistent choice for the previous proposal as the morpheme items implies that it concerns all of the sequence members and the morpheme rules implies that a set of rules is expected.
There are currently five rules to define constraints on container objects that are either sequences or mappings:
itemsdefines a sequence of individual sets of rules for each item in a sequencekeyschemadefines one set of rules that all keys of a mapping must matchschemavalueschemadefines one set of rules that all values of a mapping must matchProposal 1
the different meanings of
schemahave been a source of confusion among users and it also forces us to operate with some assumptions in the code and to add some necessary overhead around this.therefore the next major relase should clarify semantics on the
schemarule. it's quiet obvious that its name points to the first mentioned mapping-related semantic as it matches the overall usage of the term schema in Cerberus' nomenclature.the name of the other rule should be chosen wisely to imply both the similarity with and the difference to the
itemsrule.i can think of the following atm:
(see rationale in P2)allitems(see rationale in P2)eachitemitemsrulesProposal 2
as the comprehension above shows, there are two categories of rules in this realm: those that define a set of rules for particular items or just any item of a container object and those that define a schema that assigns such set of rules to values identified by a key. it'd be therefore terminologically stringent to rename
keyschemaandvalueschematokeysrulesandvaluesrules. as there are no name conflicts, the previous names can still be used as aliases.with these terms,
itemsruleswould be a consistent choice for the previous proposal as the morphemeitemsimplies that it concerns all of the sequence members and the morphemerulesimplies that a set of rules is expected.