From f0aa515c8bcd59e8bc0449dd6c29fc6cd6d8ad08 Mon Sep 17 00:00:00 2001 From: benne-dee <78043691+benne-dee@users.noreply.github.com> Date: Mon, 22 Feb 2021 22:17:06 +0530 Subject: [PATCH] [netinstall] Schema validates also groups file --- src/modules/netinstall/netinstall.schema.yaml | 45 ++++++++++++------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/src/modules/netinstall/netinstall.schema.yaml b/src/modules/netinstall/netinstall.schema.yaml index e1db5715e..05ab4cd08 100644 --- a/src/modules/netinstall/netinstall.schema.yaml +++ b/src/modules/netinstall/netinstall.schema.yaml @@ -1,4 +1,5 @@ # SPDX-FileCopyrightText: 2020 Adriaan de Groot +# SPDX-FileContributor: benne-dee ( worked on groups schema ) # SPDX-License-Identifier: GPL-3.0-or-later --- $schema: https://json-schema.org/draft-07/schema# @@ -7,11 +8,11 @@ definitions: package: $id: '#definitions/package' oneOf: - - + - type: string description: bare package - actual package name as passed to the package manager (e.g. `qt5-creator-dev`). - - + - type: object description: rich package - one with a package-name (for the package-manager) and a description (for the human). @@ -59,16 +60,30 @@ definitions: type: array items: { $ref: '#definitions/group' } -additionalProperties: false -type: object -properties: - groupsUrl: { type: string } - required: { type: boolean, default: false } - label: # Translatable labels - type: object - additionalProperties: true - properties: - sidebar: { type: string } - title: { type: string } - groups: { $ref: '#definitions/groups' } # DONE: the schema for groups -required: [ groupsUrl ] +oneOf: +- # netinstall.conf + type: object + description: netinstall.conf schema + additionalProperties: false + properties: + groupsUrl: { type: string } + required: { type: boolean, default: false } + label: # Translatable labels + type: object + additionalProperties: true + properties: + sidebar: { type: string } + title: { type: string } + groups: { $ref: '#definitions/groups' } + required: [ groupsUrl ] + +- # Groups file with top level *groups* key + type: object + description: Groups file with top level *groups* key + additionalProperties: false + properties: + groups: { $ref: '#definitions/groups' } + required: [ groups ] + +- # Groups file bare + { $ref: '#definitions/groups' }