[preservefiles] Add a schema-file

This commit is contained in:
Adriaan de Groot 2021-12-13 16:56:07 +01:00
parent 778c2855f4
commit d3ed5663d0

View File

@ -0,0 +1,37 @@
# SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
# SPDX-License-Identifier: GPL-3.0-or-later
---
$schema: https://json-schema.org/schema#
$id: https://calamares.io/schemas/preservefiles
additionalProperties: false
type: object
properties:
# TODO: it's a particularly-formatted string
perm: { type: string }
files:
type: array
items:
# There are three entries here because: string, or an entry with
# a src (but no from) or an entry with from (but no src).
anyOf:
- type: string
- type: object
properties:
dest: { type: string }
src: { type: string }
# TODO: it's a particularly-formatted string
perm: { type: string }
optional: { type: boolean }
required: [ dest ]
additionalProperties: false
- type: object
properties:
dest: { type: string }
from: { type: string, enum: [config, log] }
# TODO: it's a particularly-formatted string
perm: { type: string }
optional: { type: boolean }
required: [ dest ]
additionalProperties: false
required: [ files ]