Skip to content

Conversation

eerhardt
Copy link
Member

Description

There are expectations in other integrations that primitive environment variables are serialized to strings and not random objects like enums and bools.

Fix #10432

There are expectations in other integrations that primitive environment variables are serialized to strings and not random objects like enums and bools.

Fix dotnet#10432
@eerhardt eerhardt added this to the 9.4 milestone Jul 15, 2025
@github-actions github-actions bot added the area-integrations Issues pertaining to Aspire Integrations packages label Jul 15, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR ensures that all YARP environment variables are serialized as strings rather than primitive objects like enums and booleans, addressing compatibility expectations with other integrations.

  • Converts all simple primitive values to strings using ToString() in the environment variable flattening process
  • Specifically handles SSL protocol enum serialization to strings
  • Adds a test to verify all environment variables are strings

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Aspire.Hosting.Yarp/YarpEnvConfigGenerator.cs Modified FlattenToEnvVars method to convert all primitive values and SSL protocol enums to strings
tests/Aspire.Hosting.Yarp.Tests/YarpConfigGeneratorTests.cs Added test EnsureAllEnvVarsAreStrings to verify all environment variables are string type

@eerhardt
Copy link
Member Author

/backport to release/9.4

@github-actions
Copy link
Contributor

Started backporting to release/9.4: https://github.com/dotnet/aspire/actions/runs/16301517054

@davidfowl davidfowl enabled auto-merge (squash) July 15, 2025 18:38
@davidfowl davidfowl merged commit 6d93e1b into dotnet:main Jul 15, 2025
276 of 277 checks passed
@eerhardt eerhardt deleted the FixYarp10432 branch July 15, 2025 18:48
@github-actions github-actions bot locked and limited conversation to collaborators Aug 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-integrations Issues pertaining to Aspire Integrations packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unhandled exception: Unsupported value type System.Boolean when referencing Azure Storage resource

2 participants