public static string GetPropertyValues()

in src/TemplateRefGenerator/Generators/MarkdownGenerator.cs [902:973]


    public static string GetPropertyValues(ResourceMetadata resource, DeploymentType deploymentType, ImmutableArray<NamedType> namedTypes, RemarksFile remarks, int anchorIndex)
    {
        var anchorSuffix = anchorIndex > 0 ? $"-{anchorIndex}" : "";
        var remarksByObjectName = remarks.GetPropertyRemarks(resource).ToLookup(x => x.ObjectName, StringComparer.OrdinalIgnoreCase);

        var sb = new StringBuilder();
        void writeHeading(string name) {
                    sb.Append($"""
### {name}

| Name | Description | Value |
| ---- | ----------- | ------------ |

""");
        }

        void writeProperties(string typeName, IReadOnlyDictionary<string, ObjectTypeProperty> properties) {
            var remarksByPropertyName = remarksByObjectName[typeName]
                .ToDictionary(x => x.PropertyName, StringComparer.OrdinalIgnoreCase);

            var propertyData = GetProperties(resource, deploymentType, typeName, properties, remarksByObjectName[typeName], anchorIndex)
                .OrderBy(x => x.Name, StringComparer.OrdinalIgnoreCase);

            foreach (var property in propertyData)
            {
                var description = MarkdownUtils.ConvertDocsLinks(property.Description ?? "");

                sb.Append($"""
| {property.Name} | {MarkdownUtils.Escape(description)} | {property.Type} |

""");
            }
        }

        foreach (var (name, type) in namedTypes.OrderBy(x => x.Name, StringComparer.OrdinalIgnoreCase))
        {
            switch (type)
            {
                case ObjectType objectType: {
                    writeHeading(name);
                    writeProperties(name, objectType.Properties);
                    sb.AppendLine("");
                    break;
                }
                case DiscriminatedObjectType discType: {
                    var typeLookup = discType.Elements
                        .ToDictionary(x => x.Key, x => (x.Value.Type as ObjectType)!);


                    if (typeLookup.Values.Any(x => x is null))
                    {
                        throw new InvalidOperationException($"Expected all discriminated elements to be objects");
                    }

                    var discriminatorProperty = new ObjectTypeProperty(
                        new StaticTypeReference(new UnionType(discType.Elements.Keys
                            .Select(x => new StaticTypeReference(new StringLiteralType(x)))
                            .ToList())),
                        ObjectTypePropertyFlags.Required,
                        string.Join(' ', typeLookup.Select(x => $"Set to '{x.Key}' for type {MarkdownUtils.GetLink(x.Value.Name, MarkdownUtils.GetDocAnchor($"{x.Value.Name}{anchorSuffix}"))}.")));

                    writeHeading(name);
                    writeProperties(name, discType.BaseProperties.ToImmutableDictionary().Add(discType.Discriminator, discriminatorProperty));
                    sb.AppendLine("");
                    break;
                }
            }
            
        }

        return sb.ToString();
    }