Ensure all YARP env vars are strings#10434
Merged
davidfowl merged 1 commit intodotnet:mainfrom Jul 15, 2025
Merged
Conversation
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
Contributor
There was a problem hiding this comment.
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 |
davidfowl
approved these changes
Jul 15, 2025
Member
Author
|
/backport to release/9.4 |
Contributor
|
Started backporting to release/9.4: https://github.com/dotnet/aspire/actions/runs/16301517054 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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