diff --git a/docs/UserGuide.md b/docs/UserGuide.md index f9479c0a0..6f20f308e 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -153,6 +153,8 @@ These sections are combined to form the [complete profile](#Example-Profile). * For a larger profile example see [The schema documentation](user/Schema.md) * Further examples can be found in [the Examples folder](https://github.com/finos/datahelix/tree/master/examples) +A Beta feature has been developed for generating nested data (as a step towards support for relational data), for further information see [the Relational data documentation](RelationalData.md). + # Fields Fields are the "slots" of data that can take values. Typical fields might be _email_address_ or _user_id_. By default, any piece of data is valid for a field. This is an example field object for the profile: diff --git a/profile/src/main/resources/profileschema/datahelix.schema.json b/profile/src/main/resources/profileschema/datahelix.schema.json index 7bf07b4d8..62e2896a7 100644 --- a/profile/src/main/resources/profileschema/datahelix.schema.json +++ b/profile/src/main/resources/profileschema/datahelix.schema.json @@ -30,6 +30,13 @@ "items": { "$ref": "#/definitions/constraint" } + }, + "relationships": { + "title": "Defines any child objects", + "type": "array", + "items": { + "$ref": "#/definitions/relationship" + } } }, "definitions": { @@ -947,7 +954,74 @@ "type": "string" } } + }, + "relationship": { + "title": "Defines any nested child objects", + "type": "object", + "additionalProperties": false, + "required": [ + "name" + ], + "default": { + "name": "relationshipName", + "type": "string", + "formatting": "", + "unique": false, + "nullable": true + }, + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "profileFile": { + "type": "string" + }, + "profile": { + "type": "object", + "additionalProperties": false, + "required": [ + "fields" + ], + "properties": { + "additionalProperties": false, + "description": { + "title": "A description of what data the sub-profile is modelling", + "type": "string" + }, + "fields": { + "title": "The fields that data will be produced for. Field names must begin with an alphabetic character.", + "type": "array", + "minItems": 1, + "uniqueItems": true, + "additionalItems": false, + "items": { + "$ref": "#/definitions/field" + } + }, + "constraints": { + "title": "The constraints on the data to be output", + "type": "array", + "additionalItems": false, + "items": { + "$ref": "#/definitions/constraint" + } + }, + "relationships": { + "title": "Defines any child objects", + "type": "array", + "items": { + "$ref": "#/definitions/relationship" + } + } + } + }, + "extents": { + "type": "array" + } + } } } } -