From 5ca56e01e49929c0d7df293681e1bff621f3c278 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Thu, 1 Oct 2026 08:27:38 +0800 Subject: [PATCH 1/2] Make ResourceUrlAnnotation.DisplayOrder a non-obsolete property Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../AzureCosmosDBExtensions.cs | 2 -- .../DurableTaskResourceExtensions.cs | 2 -- .../KafkaBuilderExtensions.cs | 2 -- .../MilvusBuilderExtensions.cs | 2 -- .../MongoDBBuilderExtensions.cs | 2 -- .../MySqlBuilderExtensions.cs | 2 -- .../PostgresBuilderExtensions.cs | 2 -- .../QdrantBuilderExtensions.cs | 2 -- .../RabbitMQBuilderExtensions.cs | 2 -- .../RedisBuilderExtensions.cs | 2 -- .../ApplicationModel/ResourceUrlAnnotation.cs | 10 ++------ .../Dashboard/DashboardEventHandlers.cs | 2 -- .../Dcp/ResourceSnapshotBuilder.cs | 6 ----- .../Orchestrator/ApplicationOrchestrator.cs | 2 -- ...TwoPassScanningGeneratedAspire.verified.go | 2 ++ ...TwoPassScanningGeneratedAspire.verified.ts | 2 ++ tests/Aspire.Hosting.Tests/WithUrlsTests.cs | 23 +++++++++++++++++-- 17 files changed, 27 insertions(+), 40 deletions(-) diff --git a/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBExtensions.cs b/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBExtensions.cs index 7acef14007f..3fb86f9bc50 100644 --- a/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBExtensions.cs +++ b/src/Aspire.Hosting.Azure.CosmosDB/AzureCosmosDBExtensions.cs @@ -506,9 +506,7 @@ public static IResourceBuilder WithDataExplorer(t .WithUrlForEndpoint(dataExplorerEndpointName, c => { c.DisplayText = "Manage"; -#pragma warning disable CS0618 // DisplayOrder is obsolete but must still be set to prioritize this URL. c.DisplayOrder = 1; -#pragma warning restore CS0618 }); if (builder.ApplicationBuilder.ExecutionContext.IsRunMode) diff --git a/src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskResourceExtensions.cs b/src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskResourceExtensions.cs index ba0c5817726..a4630c4595f 100644 --- a/src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskResourceExtensions.cs +++ b/src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskResourceExtensions.cs @@ -153,9 +153,7 @@ public static IResourceBuilder RunAsEmulator(this .WithUrlForEndpoint("dashboard", c => { c.DisplayText = "Manage"; -#pragma warning disable CS0618 // DisplayOrder is obsolete but must still be set to prioritize this URL. c.DisplayOrder = 1; -#pragma warning restore CS0618 }) .WithAnnotation(new ContainerImageAnnotation { diff --git a/src/Aspire.Hosting.Kafka/KafkaBuilderExtensions.cs b/src/Aspire.Hosting.Kafka/KafkaBuilderExtensions.cs index da8606385c2..878234b2085 100644 --- a/src/Aspire.Hosting.Kafka/KafkaBuilderExtensions.cs +++ b/src/Aspire.Hosting.Kafka/KafkaBuilderExtensions.cs @@ -122,13 +122,11 @@ public static IResourceBuilder WithKafkaUI(this IResourceBu foreach (var kafkaResource in @event.Model.Resources.OfType()) { kafkaUiBuilder.WithRelationship(kafkaResource, KnownRelationshipTypes.Manages); -#pragma warning disable CS0618 // DisplayOrder is obsolete but must still be set to prioritize this URL. builder.ApplicationBuilder.CreateResourceBuilder(kafkaResource).WithUrlForEndpoint(kafkaUi.PrimaryEndpoint, url => { url.DisplayText = "Manage"; url.DisplayOrder = 1; }); -#pragma warning restore CS0618 } return Task.CompletedTask; diff --git a/src/Aspire.Hosting.Milvus/MilvusBuilderExtensions.cs b/src/Aspire.Hosting.Milvus/MilvusBuilderExtensions.cs index 0f62c2d1b80..26a453ae16f 100644 --- a/src/Aspire.Hosting.Milvus/MilvusBuilderExtensions.cs +++ b/src/Aspire.Hosting.Milvus/MilvusBuilderExtensions.cs @@ -158,13 +158,11 @@ public static IResourceBuilder WithAttu(this IResourceBuilder builder, .ExcludeFromManifest(); resourceBuilder.WithHidden(); -#pragma warning disable CS0618 // DisplayOrder is obsolete but must still be set to prioritize this URL. builder.WithUrlForEndpoint(attuContainer.PrimaryEndpoint, url => { url.DisplayText = "Manage"; url.DisplayOrder = 1; }); -#pragma warning restore CS0618 configureContainer?.Invoke(resourceBuilder); diff --git a/src/Aspire.Hosting.MongoDB/MongoDBBuilderExtensions.cs b/src/Aspire.Hosting.MongoDB/MongoDBBuilderExtensions.cs index 85e4038be53..a82ea551697 100644 --- a/src/Aspire.Hosting.MongoDB/MongoDBBuilderExtensions.cs +++ b/src/Aspire.Hosting.MongoDB/MongoDBBuilderExtensions.cs @@ -330,13 +330,11 @@ public static IResourceBuilder WithMongoExpress(this IResourceBuilder b .ExcludeFromManifest(); resourceBuilder.WithHidden(); -#pragma warning disable CS0618 // DisplayOrder is obsolete but must still be set to prioritize this URL. builder.WithUrlForEndpoint(mongoExpressContainer.PrimaryEndpoint, url => { url.DisplayText = "Manage"; url.DisplayOrder = 1; }); -#pragma warning restore CS0618 configureContainer?.Invoke(resourceBuilder); diff --git a/src/Aspire.Hosting.MySql/MySqlBuilderExtensions.cs b/src/Aspire.Hosting.MySql/MySqlBuilderExtensions.cs index 96ccc12ef55..6da9264f9c0 100644 --- a/src/Aspire.Hosting.MySql/MySqlBuilderExtensions.cs +++ b/src/Aspire.Hosting.MySql/MySqlBuilderExtensions.cs @@ -317,13 +317,11 @@ public static IResourceBuilder WithPhpMyAdmin(this IResourceBuilder bui foreach (var mySqlResource in @event.Model.Resources.OfType()) { phpMyAdminContainerBuilder.WithRelationship(mySqlResource, KnownRelationshipTypes.Manages); -#pragma warning disable CS0618 // DisplayOrder is obsolete but must still be set to prioritize this URL. builder.ApplicationBuilder.CreateResourceBuilder(mySqlResource).WithUrlForEndpoint(phpMyAdminContainer.PrimaryEndpoint, url => { url.DisplayText = "Manage"; url.DisplayOrder = 1; }); -#pragma warning restore CS0618 } return Task.CompletedTask; diff --git a/src/Aspire.Hosting.PostgreSQL/PostgresBuilderExtensions.cs b/src/Aspire.Hosting.PostgreSQL/PostgresBuilderExtensions.cs index fce8dca83df..72f33ebbb26 100644 --- a/src/Aspire.Hosting.PostgreSQL/PostgresBuilderExtensions.cs +++ b/src/Aspire.Hosting.PostgreSQL/PostgresBuilderExtensions.cs @@ -476,13 +476,11 @@ private static void AddManagementLinks(IResourceBuilder resourceBuilder, E { resourceBuilder.WithRelationship(postgresResource, KnownRelationshipTypes.Manages); -#pragma warning disable CS0618 // DisplayOrder is obsolete but must still be set to prioritize this URL. resourceBuilder.ApplicationBuilder.CreateResourceBuilder(postgresResource).WithUrlForEndpoint(endpoint, url => { url.DisplayText = displayText; url.DisplayOrder = 1; }); -#pragma warning restore CS0618 } return Task.CompletedTask; diff --git a/src/Aspire.Hosting.Qdrant/QdrantBuilderExtensions.cs b/src/Aspire.Hosting.Qdrant/QdrantBuilderExtensions.cs index e185acd975f..11e2f5adbf1 100644 --- a/src/Aspire.Hosting.Qdrant/QdrantBuilderExtensions.cs +++ b/src/Aspire.Hosting.Qdrant/QdrantBuilderExtensions.cs @@ -99,9 +99,7 @@ public static IResourceBuilder AddQdrant(this IDistributed c.DisplayLocation = UrlDisplayLocation.DetailsOnly; }) .WithUrlForEndpoint(QdrantServerResource.HttpEndpointName, c => c.DisplayText = "Qdrant (HTTP)") -#pragma warning disable CS0618 // DisplayOrder is obsolete but must still be set to prioritize this URL. .WithUrlForEndpoint(QdrantServerResource.HttpEndpointName, e => new ResourceUrlAnnotation() { Url = "/dashboard", DisplayText = "Manage", DisplayOrder = 1 }); -#pragma warning restore CS0618 } /// diff --git a/src/Aspire.Hosting.RabbitMQ/RabbitMQBuilderExtensions.cs b/src/Aspire.Hosting.RabbitMQ/RabbitMQBuilderExtensions.cs index b1ffd1956a9..3d4cb46e6d4 100644 --- a/src/Aspire.Hosting.RabbitMQ/RabbitMQBuilderExtensions.cs +++ b/src/Aspire.Hosting.RabbitMQ/RabbitMQBuilderExtensions.cs @@ -230,9 +230,7 @@ public static IResourceBuilder WithManagementPlugin(this .WithUrlForEndpoint(RabbitMQServerResource.ManagementEndpointName, c => { c.DisplayText = "Manage"; -#pragma warning disable CS0618 // DisplayOrder is obsolete but must still be set to prioritize this URL. c.DisplayOrder = 1; -#pragma warning restore CS0618 }); return builder; } diff --git a/src/Aspire.Hosting.Redis/RedisBuilderExtensions.cs b/src/Aspire.Hosting.Redis/RedisBuilderExtensions.cs index dcc3db5c806..7dfd0ad77d6 100644 --- a/src/Aspire.Hosting.Redis/RedisBuilderExtensions.cs +++ b/src/Aspire.Hosting.Redis/RedisBuilderExtensions.cs @@ -470,13 +470,11 @@ private static void AddManagementLinks(IResourceBuilder resourceBuilder, E { resourceBuilder.WithRelationship(redisResource, KnownRelationshipTypes.Manages); -#pragma warning disable CS0618 // DisplayOrder is obsolete but must still be set to prioritize this URL. resourceBuilder.ApplicationBuilder.CreateResourceBuilder(redisResource).WithUrlForEndpoint(endpoint, url => { url.DisplayText = displayText; url.DisplayOrder = 1; }); -#pragma warning restore CS0618 } return Task.CompletedTask; diff --git a/src/Aspire.Hosting/ApplicationModel/ResourceUrlAnnotation.cs b/src/Aspire.Hosting/ApplicationModel/ResourceUrlAnnotation.cs index 31e42050d72..b695d6a6141 100644 --- a/src/Aspire.Hosting/ApplicationModel/ResourceUrlAnnotation.cs +++ b/src/Aspire.Hosting/ApplicationModel/ResourceUrlAnnotation.cs @@ -28,13 +28,9 @@ public sealed class ResourceUrlAnnotation : IResourceAnnotation public EndpointReference? Endpoint { get; init; } /// - /// The display order the URL. Higher values mean sort higher in the list. + /// Gets or sets the display order of the URL. Higher values mean sort higher in the list. /// - /// - /// This member was incorrectly created as a field. It will be re-added as a property in a future Aspire version. - /// - [Obsolete("DisplayOrder was incorrectly created as a field. It will be re-added as a property in a future Aspire version.")] - public int? DisplayOrder; + public int? DisplayOrder { get; set; } /// /// Locations where this URL should be shown on the dashboard. Defaults to . @@ -45,7 +41,6 @@ public sealed class ResourceUrlAnnotation : IResourceAnnotation internal ResourceUrlAnnotation WithEndpoint(EndpointReference endpoint) { -#pragma warning disable CS0618 // DisplayOrder is obsolete but must still be copied for compatibility. return new() { Url = Url, @@ -54,7 +49,6 @@ internal ResourceUrlAnnotation WithEndpoint(EndpointReference endpoint) DisplayOrder = DisplayOrder, DisplayLocation = DisplayLocation }; -#pragma warning restore CS0618 } } diff --git a/src/Aspire.Hosting/Dashboard/DashboardEventHandlers.cs b/src/Aspire.Hosting/Dashboard/DashboardEventHandlers.cs index 401dc0bac34..1fea6365cbf 100644 --- a/src/Aspire.Hosting/Dashboard/DashboardEventHandlers.cs +++ b/src/Aspire.Hosting/Dashboard/DashboardEventHandlers.cs @@ -309,9 +309,7 @@ private void ConfigureAspireDashboardResource(IResource dashboardResource) // Other endpoints are for the dashboard UI. There are typically dashboard UI endpoints for http and https. // Order these before non-browser usable endpoints. url.DisplayText = $"Dashboard ({endpoint.EndpointName})"; -#pragma warning disable CS0618 // DisplayOrder is obsolete but must still be set for compatibility. url.DisplayOrder = 1; -#pragma warning restore CS0618 // Append the browser token to the URL as a query string parameter if token is configured if (!string.IsNullOrEmpty(browserToken)) diff --git a/src/Aspire.Hosting/Dcp/ResourceSnapshotBuilder.cs b/src/Aspire.Hosting/Dcp/ResourceSnapshotBuilder.cs index 9370383577a..1c5d6334b61 100644 --- a/src/Aspire.Hosting/Dcp/ResourceSnapshotBuilder.cs +++ b/src/Aspire.Hosting/Dcp/ResourceSnapshotBuilder.cs @@ -327,9 +327,7 @@ private ImmutableArray GetUrls(CustomResource resource, string? res endpointUrl.IsInternal) { IsInactive = isInactive, -#pragma warning disable CS0618 // DisplayOrder is obsolete but must still be flowed for compatibility. DisplayProperties = new(endpointUrl.DisplayText ?? "", endpointUrl.DisplayOrder ?? 0) -#pragma warning restore CS0618 }); processedEndpointUrls.Add(endpointUrl); } @@ -355,9 +353,7 @@ private ImmutableArray GetUrls(CustomResource resource, string? res new(Name: endpointName, Url: endpointUrl.Url, IsInternal: endpointUrl.IsInternal) { IsInactive = !isActive, -#pragma warning disable CS0618 // DisplayOrder is obsolete but must still be flowed for compatibility. DisplayProperties = new(endpointUrl.DisplayText ?? "", endpointUrl.DisplayOrder ?? 0) -#pragma warning restore CS0618 }); } @@ -368,9 +364,7 @@ private ImmutableArray GetUrls(CustomResource resource, string? res new(Name: null, Url: url.Url, IsInternal: url.IsInternal) { IsInactive = !resourceRunning, -#pragma warning disable CS0618 // DisplayOrder is obsolete but must still be flowed for compatibility. DisplayProperties = new(url.DisplayText ?? "", url.DisplayOrder ?? 0) -#pragma warning restore CS0618 }); } } diff --git a/src/Aspire.Hosting/Orchestrator/ApplicationOrchestrator.cs b/src/Aspire.Hosting/Orchestrator/ApplicationOrchestrator.cs index be82df415c3..c84b5e25bd8 100644 --- a/src/Aspire.Hosting/Orchestrator/ApplicationOrchestrator.cs +++ b/src/Aspire.Hosting/Orchestrator/ApplicationOrchestrator.cs @@ -225,9 +225,7 @@ private static IEnumerable GetResourceUrls(IResource resource) // Endpoint URLs are inactive (hidden in the dashboard) when published here. It is assumed they will get activated later when the endpoint is considered active // by whatever allocated the endpoint in the first place, e.g. for resources controlled by DCP, when DCP detects the endpoint is listening. IsInactive = url.Endpoint is not null, -#pragma warning disable CS0618 // DisplayOrder is obsolete but must still be flowed for compatibility. DisplayProperties = new(url.DisplayText ?? "", url.DisplayOrder ?? 0) -#pragma warning restore CS0618 }); } return urls; diff --git a/tests/Aspire.Hosting.CodeGeneration.Go.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.go b/tests/Aspire.Hosting.CodeGeneration.Go.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.go index ab913f8c43b..a56f80e9725 100644 --- a/tests/Aspire.Hosting.CodeGeneration.Go.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.go +++ b/tests/Aspire.Hosting.CodeGeneration.Go.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.go @@ -1040,6 +1040,7 @@ type ResourceUrlAnnotation struct { Url string `json:"Url,omitempty"` DisplayText *string `json:"DisplayText,omitempty"` Endpoint *EndpointReference `json:"Endpoint,omitempty"` + DisplayOrder *float64 `json:"DisplayOrder,omitempty"` DisplayLocation UrlDisplayLocation `json:"DisplayLocation,omitempty"` } @@ -1049,6 +1050,7 @@ func (d *ResourceUrlAnnotation) ToMap() map[string]any { m["Url"] = serializeValue(d.Url) if d.DisplayText != nil { m["DisplayText"] = serializeValue(d.DisplayText) } if d.Endpoint != nil { m["Endpoint"] = serializeValue(d.Endpoint) } + if d.DisplayOrder != nil { m["DisplayOrder"] = serializeValue(d.DisplayOrder) } m["DisplayLocation"] = serializeValue(d.DisplayLocation) return m } diff --git a/tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.ts b/tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.ts index b7399c10833..a8729954771 100644 --- a/tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.ts +++ b/tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.ts @@ -1313,6 +1313,8 @@ export interface ResourceUrlAnnotation { displayText?: string | null; /** The endpoint associated with this URL. Can be `null` if this URL is not associated with an endpoint. */ endpoint?: EndpointReference; + /** Gets or sets the display order of the URL. Higher values mean sort higher in the list. */ + displayOrder?: number | null; /** Locations where this URL should be shown on the dashboard. Defaults to `SummaryAndDetails`. */ displayLocation?: UrlDisplayLocation; } diff --git a/tests/Aspire.Hosting.Tests/WithUrlsTests.cs b/tests/Aspire.Hosting.Tests/WithUrlsTests.cs index c084d40f371..bbec87a100e 100644 --- a/tests/Aspire.Hosting.Tests/WithUrlsTests.cs +++ b/tests/Aspire.Hosting.Tests/WithUrlsTests.cs @@ -15,6 +15,27 @@ namespace Aspire.Hosting.Tests; [Trait("Partition", "5")] public class WithUrlsTests(ITestOutputHelper testOutputHelper) { + [Theory] + [InlineData(null)] + [InlineData(-1)] + [InlineData(0)] + [InlineData(1000)] + public void WithEndpointPreservesDisplayOrder(int? displayOrder) + { + var endpoint = new EndpointReference(new ContainerResource("container"), "http"); + var annotation = new ResourceUrlAnnotation + { + Url = "https://example.com", + DisplayOrder = displayOrder + }; + + var updatedAnnotation = annotation.WithEndpoint(endpoint); + + Assert.Equal(displayOrder, updatedAnnotation.DisplayOrder); + Assert.Same(endpoint, updatedAnnotation.Endpoint); + Assert.Null(annotation.Endpoint); + } + [Fact] public void WithUrlsAddsAnnotationForAsyncCallback() { @@ -339,7 +360,6 @@ public async Task WithUrlForEndpointUpdatesUrlForEndpoint() using var builder = TestDistributedApplicationBuilder.Create(testOutputHelper); var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); -#pragma warning disable CS0618 // This test intentionally verifies the obsolete DisplayOrder behavior. var projectA = builder.AddProject("projecta") .WithHttpEndpoint(name: "test") .WithUrlForEndpoint("test", u => @@ -364,7 +384,6 @@ public async Task WithUrlForEndpointUpdatesUrlForEndpoint() && u.DisplayText == "Link Text" && u.Endpoint?.EndpointName == "test" && u.DisplayOrder == 1000); -#pragma warning restore CS0618 await app.StopAsync().DefaultTimeout(TestConstants.LongTimeoutDuration); } From 594346de37bdccee83e57440855f9e296f2354bc Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Thu, 1 Oct 2026 09:37:03 +0800 Subject: [PATCH 2/2] Update polyglot snapshots for DisplayOrder Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Snapshots/TwoPassScanningGeneratedAspire.verified.java | 6 ++++++ .../Snapshots/TwoPassScanningGeneratedAspire.verified.py | 1 + .../Snapshots/TwoPassScanningGeneratedAspire.verified.rs | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/tests/Aspire.Hosting.CodeGeneration.Java.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.java b/tests/Aspire.Hosting.CodeGeneration.Java.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.java index 28bda02e993..4e0ab088b31 100644 --- a/tests/Aspire.Hosting.CodeGeneration.Java.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.java +++ b/tests/Aspire.Hosting.CodeGeneration.Java.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.java @@ -22653,6 +22653,7 @@ public class ResourceUrlAnnotation implements JsonSerializable { private String url; private String displayText; private EndpointReference endpoint; + private Number displayOrder; private UrlDisplayLocation displayLocation; public String getUrl() { return url; } @@ -22661,6 +22662,8 @@ public class ResourceUrlAnnotation implements JsonSerializable { public void setDisplayText(String value) { this.displayText = value; } public EndpointReference getEndpoint() { return endpoint; } public void setEndpoint(EndpointReference value) { this.endpoint = value; } + public Number getDisplayOrder() { return displayOrder; } + public void setDisplayOrder(Number value) { this.displayOrder = value; } public UrlDisplayLocation getDisplayLocation() { return displayLocation; } public void setDisplayLocation(UrlDisplayLocation value) { this.displayLocation = value; } @@ -22673,6 +22676,8 @@ public static ResourceUrlAnnotation fromMap(Map map) { value.setDisplayText(displayTextValue == null ? null : (String) displayTextValue); var endpointValue = map.get("Endpoint"); value.setEndpoint((EndpointReference) endpointValue); + var displayOrderValue = map.get("DisplayOrder"); + value.setDisplayOrder(displayOrderValue == null ? null : ((Number) displayOrderValue).doubleValue()); var displayLocationValue = map.get("DisplayLocation"); value.setDisplayLocation(UrlDisplayLocation.fromValue((String) displayLocationValue)); return value; @@ -22683,6 +22688,7 @@ public Map toMap() { map.put("Url", AspireClient.serializeValue(url)); map.put("DisplayText", AspireClient.serializeValue(displayText)); map.put("Endpoint", AspireClient.serializeValue(endpoint)); + map.put("DisplayOrder", AspireClient.serializeValue(displayOrder)); map.put("DisplayLocation", AspireClient.serializeValue(displayLocation)); return map; } diff --git a/tests/Aspire.Hosting.CodeGeneration.Python.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.py b/tests/Aspire.Hosting.CodeGeneration.Python.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.py index 126cadebdd8..3d0f4301117 100644 --- a/tests/Aspire.Hosting.CodeGeneration.Python.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.py +++ b/tests/Aspire.Hosting.CodeGeneration.Python.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.py @@ -2052,6 +2052,7 @@ class ResourceUrlAnnotation(typing.TypedDict, total=False): Url: str DisplayText: str | None Endpoint: EndpointReference + DisplayOrder: int | None DisplayLocation: UrlDisplayLocation class RunConfiguration(typing.TypedDict, total=False): diff --git a/tests/Aspire.Hosting.CodeGeneration.Rust.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.rs b/tests/Aspire.Hosting.CodeGeneration.Rust.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.rs index 6c27b24609f..f793ac35110 100644 --- a/tests/Aspire.Hosting.CodeGeneration.Rust.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.rs +++ b/tests/Aspire.Hosting.CodeGeneration.Rust.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.rs @@ -1830,6 +1830,8 @@ pub struct ResourceUrlAnnotation { pub display_text: Option, #[serde(rename = "Endpoint", skip_serializing_if = "Option::is_none")] pub endpoint: Option, + #[serde(rename = "DisplayOrder", skip_serializing_if = "Option::is_none")] + pub display_order: Option, #[serde(rename = "DisplayLocation")] pub display_location: UrlDisplayLocation, } @@ -1842,6 +1844,9 @@ impl ResourceUrlAnnotation { if let Some(ref v) = self.endpoint { map.insert("Endpoint".to_string(), serde_json::to_value(v).unwrap_or(Value::Null)); } + if let Some(ref v) = self.display_order { + map.insert("DisplayOrder".to_string(), serde_json::to_value(v).unwrap_or(Value::Null)); + } map.insert("DisplayLocation".to_string(), serde_json::to_value(&self.display_location).unwrap_or(Value::Null)); map }