diff --git a/bundle/internal/docs/docs.go b/bundle/internal/docs/docs.go index 35bb13887..24e8ba6ee 100644 --- a/bundle/internal/docs/docs.go +++ b/bundle/internal/docs/docs.go @@ -61,6 +61,12 @@ func getNodes(s jsonschema.Schema, refs map[string]jsonschema.Schema, customFiel additionalProps, ok := v.AdditionalProperties.(*jsonschema.Schema) if ok { objectKeyType := resolveRefs(additionalProps, refs) + if node.Description == "" { + node.Description = getDescription(objectKeyType, true) + } + if len(node.Example) == 0 { + node.Example = getExample(objectKeyType) + } node.ObjectKeyAttributes = getAttributes(objectKeyType.Properties, refs) rootProps = append(rootProps, extractNodes(k, objectKeyType.Properties, refs, customFields)...) } diff --git a/bundle/internal/docs/main.go b/bundle/internal/docs/main.go index beb4954c8..f2f0cc55d 100644 --- a/bundle/internal/docs/main.go +++ b/bundle/internal/docs/main.go @@ -88,11 +88,11 @@ func generateDocs(inputPaths []string, outputPath string, rootType reflect.Type, if isCustomField { customFields[jsonschema.TypePath(typ)] = true } - schemas[jsonschema.TypePath(typ)] = s refPath := getPath(typ) shouldHandle := strings.HasPrefix(refPath, "github.com") if !shouldHandle { + schemas[jsonschema.TypePath(typ)] = s return s } @@ -110,6 +110,7 @@ func generateDocs(inputPaths []string, outputPath string, rootType reflect.Type, assignAnnotation(v, a[k]) } + schemas[jsonschema.TypePath(typ)] = s return s }, })