From 14721deb3a1902ffe30457f2c450452b9fd9b1a0 Mon Sep 17 00:00:00 2001 From: Ilya Kuznetsov Date: Wed, 15 Jan 2025 19:15:57 +0100 Subject: [PATCH] fix: More documentation for internal types --- bundle/internal/docs/nodes.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bundle/internal/docs/nodes.go b/bundle/internal/docs/nodes.go index be0a2f105..9d9bbf8b5 100644 --- a/bundle/internal/docs/nodes.go +++ b/bundle/internal/docs/nodes.go @@ -7,6 +7,8 @@ import ( "github.com/databricks/cli/libs/jsonschema" ) +// rootNode is an intermediate representation of resolved JSON-schema item that is used to generate documentation +// Every schema node goes follows this conversion `JSON-schema -> rootNode -> markdown text` type rootNode struct { Title string Description string @@ -26,9 +28,15 @@ type attributeNode struct { } type rootProp struct { - k string - v *jsonschema.Schema + // k is the name of the property + k string + // v is the corresponding json-schema node + v *jsonschema.Schema + // topLevel is true only for direct properties of the schema of root type (e.g. config.Root or config.Resources) + // Example: config.Root has . topLevel bool + // circular indicates if property was added by recursive type, e.g. task.for_each_task.task.for_each_task + // These entries don't expand further and don't add any new nodes from their properties circular bool }