Repository navigation
Add MetadataStringOrArrayStjConverter - #7356
Merged
Nigusu-Allehu merged 4 commits intoJun 1, 2026
Merged
Conversation
Nigusu-Allehu
force-pushed
the
dev-nyenework-stj-metadata-string-or-array-converter
branch
from
May 6, 2026 22:34
95512c1 to
64aa684
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new System.Text.Json converter to support PackageSearchMetadata-style metadata fields that can be either a JSON string or an array of strings, as part of the NSJ → STJ migration in NuGet.Protocol.
Changes:
- Introduces
MetadataStringOrArrayStjConverterfor deserializing string-or-array fields into anIReadOnlyList<>. - Adds unit tests that compare STJ vs NSJ behavior for the converter across valid and invalid inputs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/NuGet.Core/NuGet.Protocol/Converters/MetadataStringOrArrayStjConverter.cs | Adds the new STJ converter implementation for string-or-array metadata fields. |
| test/NuGet.Core.Tests/NuGet.Protocol.Tests/Converters/MetadataStringOrArrayStjConverterTests.cs | Adds parity tests comparing STJ and NSJ deserialization behavior. |
jeffkl
previously approved these changes
May 28, 2026
jebriede
previously approved these changes
May 29, 2026
jebriede
left a comment
Contributor
There was a problem hiding this comment.
Approving with one suggestion!
jeffkl
approved these changes
Jun 1, 2026
Nigusu-Allehu
deleted the
dev-nyenework-stj-metadata-string-or-array-converter
branch
June 1, 2026 16:56
This was referenced Jun 1, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Bug
Fixes: NuGet/Home#14879
Description
This is a focused slice of #7301, split per-converter to make reviewing easier.
Converters are being migrated first so that the upcoming Registration resource migrations don't become bloated PRs.
MetadataStringOrArrayStjConverterdeserializes a JSON string or array of strings into an IReadOnlyList maintaining full behavioral parity with the NSJMetadataStringOrArrayConverter.Intentional divergence from NSJ: Null elements within an array
(e.g., ["owner1", null, "owner2"])are filtered out rather than preserved. The NSJ converter passed them through as null values in the listPR Checklist