From 4eb112bee37dfbffae8a97b1c9994d4b9821c8f8 Mon Sep 17 00:00:00 2001 From: mr Date: Wed, 18 Mar 2026 09:17:22 +0100 Subject: [PATCH] Debug --- models/workflow/plantuml.go | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/models/workflow/plantuml.go b/models/workflow/plantuml.go index b1fe6e2..2903313 100644 --- a/models/workflow/plantuml.go +++ b/models/workflow/plantuml.go @@ -183,12 +183,16 @@ func plantUMLLinkComment(link graph.GraphLink) string { // Flat-map helpers (shared by import & export) // --------------------------------------------------------------------------- -// plantUMLSkipFields lists JSON field names that must never appear in comments. -// Checked against the root key of each dot-notation path. +// plantUMLSkipFields lists JSON field names (root keys) that must never appear +// in human-readable comments. All names are the actual JSON tags, not Go field names. var plantUMLSkipFields = map[string]bool{ - // identity / meta - "uuid": true, "name": true, "created_at": true, "updated_at": true, - "creator_id": true, "is_draft": true, + // AbstractObject — identity & audit (json tags) + "id": true, "name": true, "is_draft": true, "access_mode": true, "signature": true, + "creator_id": true, "user_creator_id": true, + "creation_date": true, "update_date": true, + "updater_id": true, "user_updater_id": true, + // internal resource type identifier (AbstractResource.Type / GetType()) + "type": true, // relationships / pricing "instances": true, "partnerships": true, "allowed_booking_modes": true, "usage_restrictions": true, @@ -200,6 +204,10 @@ var plantUMLSkipFields = map[string]bool{ "kind": true, "params": true, } +// zeroTimeStr is the JSON representation of Go's zero time.Time value. +// encoding/json does not treat it as "empty" for omitempty, so we filter it explicitly. +const zeroTimeStr = "0001-01-01T00:00:00Z" + // plantUMLToFlatMap marshals v to JSON and flattens the resulting object into // a map[string]string using dot notation for nested keys, skipping zero values // and known meta fields. @@ -247,7 +255,7 @@ func plantUMLFlattenJSON(m map[string]interface{}, prefix string, result map[str result[fullKey] = "true" } case string: - if val != "" { + if val != "" && val != zeroTimeStr { result[fullKey] = val } }