From a300dfb30f89139c24913437836044aa911783bb Mon Sep 17 00:00:00 2001 From: iripiri Date: Thu, 12 May 2022 17:38:51 +0000 Subject: [PATCH] extend json template Signed-off-by: iripiri --- json_ld/templates/json_ld_template.mustache | 48 ++++++++++++--------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/json_ld/templates/json_ld_template.mustache b/json_ld/templates/json_ld_template.mustache index 9bdbbe28..bfc144e1 100644 --- a/json_ld/templates/json_ld_template.mustache +++ b/json_ld/templates/json_ld_template.mustache @@ -1,27 +1,33 @@ { - "$schema": "http://json-schema.org/schema#", + "$schema": "http://json-schema.org/schema#", "$schemaVersion": "0.0.1", "modelTags": "", - "title": "{{class_name}}", - "description": "{{class_comment}}", - "type": "object", - "allOf": [ - { - "properties": { - "type": { - "type": "string", - "enum": [ - "{{class_name}}" - ], - "description": "Property, NGSI type. Has to be {{class_name}}." - }, + "title": "Smart Data Models - {{class_name}}", + "description": "{{class_comment}}", + "type": "object", + "allOf": [ + { + "$ref": "https://smart-data-models.github.io/data-models/common-schema.json#/definitions/GSMA-Commons" + }, + { + "$ref": "https://smart-data-models.github.io/data-models/common-schema.json#/definitions/Location-Commons" + }, + { + "properties": { + "type": { + "type": "string", + "enum": [ + "{{class_name}}" + ], + "description": "Property. NGSI type. It has to be {{class_name}}" + }, {{#attributes}} - "{{label}}": { - "description": "{{comment}}", - "type": "number" - }, + "{{label}}": { + "description": "Property. Model:'https://schema.org/Number'. {{comment}} Default: {{#setDefault}}{{dataType}}{{/setDefault}}", + "type": "number" + }, {{/attributes}} - } - } - ] + } + } + ] } \ No newline at end of file