private static string GetConstraintText()

in src/TemplateRefGenerator/Generators/MarkdownGenerator.cs [758:780]


    private static string GetConstraintText(StringType stringType)
    {
        var constraints = new List<string>();
        
        if (stringType.MinLength is not null)
        {
            constraints.Add($"Min length = {stringType.MinLength}");
        }
        if (stringType.MaxLength is not null)
        {
            constraints.Add($"Max length = {stringType.MaxLength}");
        }
        if (stringType.Sensitive is true)
        {
            constraints.Add($"Sensitive value. Pass in as a secure parameter.");
        }
        if (stringType.Pattern is not null)
        {
            constraints.Add($"Pattern = `{stringType.Pattern}`");
        }

        return constraints.Any() ? $" {Br}{Br}" + JoinWithBr("Constraints:", JoinWithBr(constraints)) : "";
    }