From 666c1f019c275a65fe96246a20e5bd3fbd73a8dd Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Fri, 31 Jul 2015 12:07:40 +0100 Subject: Add schemas for Baserock definitions format See schemas/README.schemas for information. Change-Id: I6c384692dbf70017a3ece2ed56c1f8cbe60b493d --- schemas/stratum.json-schema | 99 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 schemas/stratum.json-schema (limited to 'schemas/stratum.json-schema') diff --git a/schemas/stratum.json-schema b/schemas/stratum.json-schema new file mode 100644 index 00000000..0330f37d --- /dev/null +++ b/schemas/stratum.json-schema @@ -0,0 +1,99 @@ +$schema: http://json-schema.org/draft-04/schema# +id: http://git.baserock.org/cgi-bin/cgit.cgi/baserock/baserock/definitions.git/tree/schemas/chunk.json-schema + +description: | + This is a JSON-Schema description of a 'stratum' .morph file, which is part + of the Baserock definitions YAML representation format. + + This JSON-Schema file is valid for VERSION 7 of the Baserock definitions + YAML serialisation format. + + The Baserock definitions format is the recommended way of representing + Baserock definitions on disk. The actual data model is described separately. + See https://wiki.baserock.org/definitions for more information. + + This schema is represented as YAML, so that it can be edited more easily. + You may need to convert to JSON if using a JSON-Schema tool that expects + its input to be an actual string containing data serialised as JSON. + +definitions: + # Defines one or more instances of StratumArtifact from the Baserock data + # model. + split-rules: + type: array + items: + type: object + + required: [artifact, include] + additionalProperties: false + + properties: + artifact: {type: string} + include: + type: array + items: + type: string + format: regex + + # Corresponds to ChunkReference in Baserock data model. + chunk-reference: + type: object + + required: [ 'repo', 'ref' ] + additionalProperties: false + + properties: + name: { type: string } + morph: { type: string } + repo: { type: string } + ref: { type: string } + unpetrify-ref: { type: string } + build-mode: { type: string } + prefix: { type: string } + build-system: { type: string } + build-depends: + type: array + items: { type: string } + artifacts: + type: object + # This defines which chunk artifacts go in which stratum artifact. + # E.g. "glibc-nss: build-essential-runtime" specifies the glibc-nss + # chunk artifact should go in the build-essential-runtime stratum + # artifact. + patternProperties: + ^.*$: { type: string } + + # This doesn't need any special treatment in the Baserock data model because + # it's a link to another stratum definition, without any extra info. + stratum-reference: + type: object + + required: [ 'morph' ] + additionalProperties: false + + properties: + morph: { type: string } + + +# Corresponds to Stratum in Baserock data model. +type: object + +required: [ 'name', 'kind', 'chunks' ] +additionalProperties: false + +properties: + name: { type: string } + kind: { enum: [ "stratum" ] } + description: { type: string } + + build-depends: + type: array + items: + $ref: "#/definitions/stratum-reference" + + products: + $ref: "#/definitions/split-rules" + + chunks: + type: array + items: { $ref: "#/definitions/chunk-reference" } -- cgit v1.2.1