From d712a04c3251f9c81593bdc9c9ad61cb5e88b675 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Mon, 2 Oct 2017 18:47:43 -0700 Subject: [PATCH] config/configschema: MinItems and MaxItems for nested blocks --- config/configschema/schema.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/config/configschema/schema.go b/config/configschema/schema.go index 2a5704840a..edddcdf81e 100644 --- a/config/configschema/schema.go +++ b/config/configschema/schema.go @@ -51,6 +51,17 @@ type NestedBlock struct { // how many instances of the block are allowed, how many labels it expects, // and how the resulting data will be converted into a data structure. Nesting NestingMode + + // MinItems and MaxItems set, for the NestingList and NestingSet nesting + // modes, lower and upper limits on the number of child blocks allowed + // of the given type. If both are left at zero, no limit is applied. + // + // As a special case, both values can be set to 1 for NestingSingle in + // order to indicate that a particular single block is required. + // + // These fields are ignored for other nesting modes and must both be left + // at zero. + MinItems, MaxItems int } // NestingMode is an enumeration of modes for nesting blocks inside other