Skip to content

WithCustomInput example missing EnableDescriptionMarkdown for markdown rendering #392

@maddymontaquila

Description

@maddymontaquila

Type of issue

Missing information

Description

The external-parameters docs show how to use WithDescription("...", enableMarkdown: true) alongside WithCustomInput for parameter prompts. However, the example code sets Description = p.Description in the WithCustomInput callback without also setting EnableDescriptionMarkdown = true on the InteractionInput object.

This means the markdown description renders as plain text in the parameter dialog — the enableMarkdown: true flag from WithDescription does not propagate through to the custom input's Description property.

Current example (doesn't render markdown in dialog)

var externalServiceUrl = builder.AddParameter("external-service-url")
    .WithDescription("The URL of the external service.")
    .WithCustomInput(p => new()
    {
        InputType = InputType.Text,
        Value = "https://example.com",
        Name = p.Name,
        Placeholder = $"Enter value for {p.Name}",
        Description = p.Description
    });

Fix — add EnableDescriptionMarkdown

var externalServiceUrl = builder.AddParameter("external-service-url")
    .WithDescription("The URL of the external service.", enableMarkdown: true)
    .WithCustomInput(p => new()
    {
        InputType = InputType.Text,
        Value = "https://example.com",
        Name = p.Name,
        Placeholder = $"Enter value for {p.Name}",
        Description = p.Description,
        EnableDescriptionMarkdown = true  // <-- needed for markdown to render
    });

Without EnableDescriptionMarkdown = true on the InteractionInput, any markdown in the description (like links) renders as raw text in the "Set parameter value" dialog.

This was discovered while trying to add a clickable link to a parameter description — it took several attempts to figure out that WithDescription(enableMarkdown: true) only affects the resource list view, not the custom input dialog.

Page URL

https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/external-parameters#prompt-for-parameter-values-in-the-dashboard

Content source URL

https://github.com/microsoft/aspire.dev/blob/main/docs/fundamentals/external-parameters.md

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions