diff options
author | Tiago Gomes <tiago.gomes@codethink.co.uk> | 2015-12-07 17:26:17 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2016-03-24 23:06:07 +0000 |
commit | 48e4a7941a4c1351076a2edf23274b41b19eab19 (patch) | |
tree | fd557cd3b093604c3f87e1f672260232ed8f625b /morphlib/schemas/7/system.json-schema | |
parent | 3b65cfe5f6123db169c64023fa9f8dda8a51ff49 (diff) | |
download | morph-48e4a7941a4c1351076a2edf23274b41b19eab19.tar.gz |
Add JSON schemas
They will be used for validating the morphologies in a future commit.
These were copied from [1], with the following changes:
* The field unpetrify-ref can be of type number in addition to type
string
* Build commands can be of type boolean in addition to type string
* minItems were set for some fields of type array
[1]: http://git.baserock.org/cgi-bin/cgit.cgi/baserock/baserock/definitions.git/tree/schemas
Change-Id: I962188ad5774472f08b10f6dfff8aac7a106ef23
Diffstat (limited to 'morphlib/schemas/7/system.json-schema')
-rw-r--r-- | morphlib/schemas/7/system.json-schema | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/morphlib/schemas/7/system.json-schema b/morphlib/schemas/7/system.json-schema new file mode 100644 index 00000000..189cc583 --- /dev/null +++ b/morphlib/schemas/7/system.json-schema @@ -0,0 +1,60 @@ +$schema: http://json-schema.org/draft-04/schema# +id: http://git.baserock.org/cgi-bin/cgit.cgi/baserock/baserock/definitions.git/tree/schemas/system.json-schema + +description: | + This is a JSON-Schema description of a 'system' .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: + # In the Baserock data model, this becomes a list of links to StratumArtifact + # entities. + stratum-reference: + type: object + + required: [ 'morph' ] + additionalProperties: false + + properties: + name: { type: string } + morph: { type: string } + artifacts: + type: array + items: { type: string } + + +# Corresponds to System in Baserock data model. +system: +type: object + +required: [ 'name', 'kind', 'strata' ] +additionalProperties: false + +properties: + name: { type: string } + kind: { enum: [ "system" ] } + description: { type: string } + + # Morph and YBD will only accept certain values for 'arch' based on + # hardcoded conditions in those tools. + arch: { type: string } + + strata: + type: array + items: + $ref: "#/definitions/stratum-reference" + minItems: 1 + + configuration-extensions: + type: array + items: { type: string } |