Make AtsJsonCodeWriter a shared internal helper - #16677
Merged
Eric Erhardt (eerhardt) merged 1 commit intoMay 5, 2026
Merged
Conversation
Move the JSON code writer out of Aspire.TypeSystem so it is not exposed as public API. Link the shared internal helper into each CLI and code generation project that uses it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Eric Erhardt (eerhardt)
requested review from
James Newton-King (JamesNK),
David Fowler (davidfowl) and
Mitch Denny (mitchdenny)
as code owners
May 1, 2026 20:39
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16677Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16677" |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes an unnecessary public surface area exposure by relocating AtsJsonCodeWriter out of Aspire.TypeSystem and into src/Shared/Json, then link-compiling it into the CLI and polyglot code generation projects that consume it.
Changes:
- Moved
AtsJsonCodeWriterintoAspire.Shared.Jsonand made it internal-only. - Updated CLI and code generators (Go/Java/Python/Rust/TypeScript) to reference the new shared helper namespace.
- Added shared-source
<Compile Include="...AtsJsonCodeWriter.cs" Link="...">entries to the affected projects.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Shared/Json/AtsJsonCodeWriter.cs | Relocates the helper into Aspire.Shared.Json and restricts it to internal usage. |
| src/Aspire.Hosting.CodeGeneration.TypeScript/AtsTypeScriptCodeGenerator.cs | Imports the new shared JSON helper namespace for relaxed JSON formatting. |
| src/Aspire.Hosting.CodeGeneration.TypeScript/Aspire.Hosting.CodeGeneration.TypeScript.csproj | Link-compiles the shared AtsJsonCodeWriter into the TypeScript generator project. |
| src/Aspire.Hosting.CodeGeneration.Rust/AtsRustCodeGenerator.cs | Imports the new shared JSON helper namespace. |
| src/Aspire.Hosting.CodeGeneration.Rust/Aspire.Hosting.CodeGeneration.Rust.csproj | Link-compiles the shared AtsJsonCodeWriter into the Rust generator project. |
| src/Aspire.Hosting.CodeGeneration.Python/AtsPythonCodeGenerator.cs | Imports the new shared JSON helper namespace. |
| src/Aspire.Hosting.CodeGeneration.Python/Aspire.Hosting.CodeGeneration.Python.csproj | Link-compiles the shared AtsJsonCodeWriter into the Python generator project. |
| src/Aspire.Hosting.CodeGeneration.Java/AtsJavaCodeGenerator.cs | Imports the new shared JSON helper namespace. |
| src/Aspire.Hosting.CodeGeneration.Java/Aspire.Hosting.CodeGeneration.Java.csproj | Link-compiles the shared AtsJsonCodeWriter into the Java generator project. |
| src/Aspire.Hosting.CodeGeneration.Go/AtsGoCodeGenerator.cs | Imports the new shared JSON helper namespace. |
| src/Aspire.Hosting.CodeGeneration.Go/Aspire.Hosting.CodeGeneration.Go.csproj | Link-compiles the shared AtsJsonCodeWriter into the Go generator project. |
| src/Aspire.Cli/Commands/Sdk/SdkDumpCommand.cs | Switches to the shared JSON helper namespace for relaxed JSON rendering. |
| src/Aspire.Cli/Aspire.Cli.csproj | Link-compiles the shared AtsJsonCodeWriter into the CLI. |
Member
Author
|
/backport to release/13.3 |
Contributor
|
Started backporting to |
Sébastien Ros (sebastienros)
approved these changes
May 4, 2026
David Fowler (davidfowl)
approved these changes
May 4, 2026
Eric Erhardt (eerhardt)
merged commit May 5, 2026
892a875
into
microsoft:main
1131 of 1140 checks passed
Nell Shamrell-Harrington (nellshamrell)
pushed a commit
to nellshamrell/aspire
that referenced
this pull request
May 18, 2026
Move the JSON code writer out of Aspire.TypeSystem so it is not exposed as public API. Link the shared internal helper into each CLI and code generation project that uses it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
AtsJsonCodeWriterwas only used by the CLI and polyglot code generation projects, so exposing it fromAspire.TypeSystemadded public API that consumers do not need. This moves the implementation tosrc\Shared\Jsonas an internal helper and link-compiles it into each project that uses it: CLI plus Go, Java, Python, Rust, and TypeScript codegen.Validation:
restore.cmddotnet.cmd buildforAspire.TypeSystem, all affected code generation projects, andAspire.Cliwith/p:SkipNativeBuild=trueFixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: