From 0cc29b889ed593654b1a1a8d502899c4c1339047 Mon Sep 17 00:00:00 2001 From: Or Novogroder <108669655+OrNovo@users.noreply.github.com> Date: Tue, 21 Nov 2023 16:55:23 +0200 Subject: [PATCH] patch - layout is required (#175) --- coralogix/resource_coralogix_dashboard.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/coralogix/resource_coralogix_dashboard.go b/coralogix/resource_coralogix_dashboard.go index 91acaed7..c0415d7b 100644 --- a/coralogix/resource_coralogix_dashboard.go +++ b/coralogix/resource_coralogix_dashboard.go @@ -1757,6 +1757,11 @@ func (r DashboardResource) Schema(_ context.Context, req resource.SchemaRequest, }, }, MarkdownDescription: "Layout configuration for the dashboard's visual elements.", + Validators: []validator.Object{ + objectvalidator.ExactlyOneOf( + path.MatchRelative().AtParent().AtName("content_json"), + ), + }, }, "variables": schema.ListNestedAttribute{ Optional: true, @@ -2451,6 +2456,9 @@ func expandDashboardTimeFrame(dashboard *dashboards.Dashboard, timeFrame *Dashbo } func expandDashboardLayout(ctx context.Context, layout *DashboardLayoutModel) (*dashboards.Layout, diag.Diagnostics) { + if layout == nil { + return nil, nil + } sections, diags := expandDashboardSections(ctx, layout.Sections) if diags.HasError() { return nil, diags