Skip to main content
Version: v0.17.0

SchemaCreate

Alias:SchemaCreate, GenerateSchema, CreateSchema

Output:Entity

Create a new schema by analysing the entity properties and values in an array or an entity stream. This Step is best used with data sources where the property values already have a data type (string, date, int...) such as JSON or databases. For generating schemas from flat data sources such as Concordance or CSV, use the SchemaCreateCoerced step, which will attempt to infer the property types.

ParameterTypeRequiredPositionDefault ValueSummary
Entities
From
array<entity>✔1The array or entity stream to analyse
AllowExtraPropertiesboolfalseWhether properties other than the explicitly defined properties are allowed.
SchemaName
Name
stringSchemaThe name of the schema to create

Examples​

Example 1​

SCL​

SchemaCreate Entities: [('StringProperty': "abc" 'IntegerProperty': 123)] SchemaName: 'My Schema'

Expected Output​

('title': "My Schema" 'type': "object" 'additionalProperties': False 'properties': ('StringProperty': ('type': "string") 'IntegerProperty': ('type': "integer")) 'required': ["StringProperty", "IntegerProperty"])

Example 2​

Since IntegerProperty is quoted, this step interprets it as a string.

SCL​

SchemaCreate Entities: [('StringProperty': "abc" 'IntegerProperty': "123")] SchemaName: 'My Schema'

Expected Output​

('title': "My Schema" 'type': "object" 'additionalProperties': False 'properties': ('StringProperty': ('type': "string") 'IntegerProperty': ('type': "string")) 'required': ["StringProperty", "IntegerProperty"])