diff --git a/dbt_semantic_interfaces/parsing/generated_json_schemas/default_explicit_schema.json b/dbt_semantic_interfaces/parsing/generated_json_schemas/default_explicit_schema.json index b023f370..dde90bbc 100644 --- a/dbt_semantic_interfaces/parsing/generated_json_schemas/default_explicit_schema.json +++ b/dbt_semantic_interfaces/parsing/generated_json_schemas/default_explicit_schema.json @@ -328,6 +328,19 @@ ], "type": "object" }, + "metric_config_schema": { + "$id": "metric_config_schema", + "additionalProperties": false, + "properties": { + "meta": { + "propertyNames": { + "type": "string" + }, + "type": "object" + } + }, + "type": "object" + }, "metric_input_measure_schema": { "$id": "metric_input_measure_schema", "oneOf": [ @@ -383,6 +396,9 @@ "$id": "metric_schema", "additionalProperties": false, "properties": { + "config": { + "$ref": "#/definitions/metric_config_schema" + }, "description": { "type": "string" }, @@ -578,6 +594,19 @@ ], "type": "object" }, + "semantic_model_config_schema": { + "$id": "semantic_model_config_schema", + "additionalProperties": false, + "properties": { + "meta": { + "propertyNames": { + "type": "string" + }, + "type": "object" + } + }, + "type": "object" + }, "semantic_model_defaults_schema": { "$id": "semantic_model_defaults_schema", "additionalProperties": false, @@ -593,6 +622,9 @@ "$id": "semantic_model_schema", "additionalProperties": false, "properties": { + "config": { + "$ref": "#/definitions/semantic_model_config_schema" + }, "defaults": { "$ref": "#/definitions/semantic_model_defaults_schema" }, diff --git a/dbt_semantic_interfaces/parsing/schemas.py b/dbt_semantic_interfaces/parsing/schemas.py index 5636a7db..dcc0a1cf 100644 --- a/dbt_semantic_interfaces/parsing/schemas.py +++ b/dbt_semantic_interfaces/parsing/schemas.py @@ -252,6 +252,15 @@ "required": ["name", "type"], } +metric_config_schema = { + "$id": "metric_config_schema", + "type": "object", + "properties": { + "meta": {"type": "object", "propertyNames": {"type": "string"}}, + }, + "additionalProperties": False, +} + # Top level object schemas metric_schema = { "$id": "metric_schema", @@ -266,6 +275,7 @@ "filter": {"$ref": "filter_schema"}, "description": {"type": "string"}, "label": {"type": "string"}, + "config": {"$ref": "metric_config_schema"}, }, "additionalProperties": False, "required": ["name", "type", "type_params"], @@ -378,6 +388,15 @@ "additionalProperties": False, } +semantic_model_config_schema = { + "$id": "semantic_model_config_schema", + "type": "object", + "properties": { + "meta": {"type": "object", "propertyNames": {"type": "string"}}, + }, + "additionalProperties": False, +} + semantic_model_schema = { "$id": "semantic_model_schema", "type": "object", @@ -396,6 +415,7 @@ "dimensions": {"type": "array", "items": {"$ref": "dimension_schema"}}, "description": {"type": "string"}, "label": {"type": "string"}, + "config": {"$ref": "semantic_model_config_schema"}, }, "additionalProperties": False, "required": ["name"], @@ -428,6 +448,8 @@ export_schema["$id"]: export_schema, export_config_schema["$id"]: export_config_schema, saved_query_query_params_schema["$id"]: saved_query_query_params_schema, + semantic_model_config_schema["$id"]: semantic_model_config_schema, + metric_config_schema["$id"]: metric_config_schema, } resources: List[Tuple[str, Resource]] = [(str(k), DRAFT7.create_resource(v)) for k, v in schema_store.items()]