From e774a8b38983d9848f71efdb1bb0c41ba36039f3 Mon Sep 17 00:00:00 2001 From: Ole Troan Date: Thu, 2 Jan 2020 22:32:57 +0100 Subject: nat: add feature.yaml And add support for multiple maintainers in JSON schema. Type: docs Change-Id: Ice430927ceecf53526a3fdf46c075a95206bf0ac Signed-off-by: Ole Troan --- src/scripts/fts.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/scripts') diff --git a/src/scripts/fts.py b/src/scripts/fts.py index eb44be9a59a..f3165ced0cd 100755 --- a/src/scripts/fts.py +++ b/src/scripts/fts.py @@ -17,9 +17,9 @@ schema = { "properties": { "name": {"type": "string"}, "description": {"type": "string"}, - "maintainer": {"type": "string"}, + "maintainer": {"$ref": "#/definitions/maintainers"}, "state": {"type": "string", - "enum": ["production", "experimental"]}, + "enum": ["production", "experimental", "development"]}, "features": {"$ref": "#/definitions/features"}, "missing": {"$ref": "#/definitions/features"}, "properties": {"type": "array", @@ -30,6 +30,14 @@ schema = { }, "additionalProperties": False, "definitions": { + "maintainers": { + "anyof": [{ + "type": "array", + "items": {"type": "string"}, + "minItems": 1, + }, + {"type": "string"}], + }, "featureobject": { "type": "object", "patternProperties": { @@ -86,7 +94,11 @@ def output_features(indent, fl): def output_markdown(features): for k, v in features.items(): print('# {}'.format(v['name'])) - print('Maintainer: {} '.format(v['maintainer'])) + if type(v['maintainer']) is list: + print('Maintainers: ' + + ', '.join('{}'.format(m) for m in v['maintainer'])) + else: + print('Maintainer: {} '.format(v['maintainer'])) print('State: {}\n'.format(v['state'])) print('{}\n'.format(v['description'])) output_features(0, v['features']) -- cgit 1.2.3-korg