From 57f0b6496d44ea6a4d8cf4e56e33d67ce2f13594 Mon Sep 17 00:00:00 2001 From: Nigusu Solomon Yenework <59111203+Nigusu-Allehu@users.noreply.github.com> Date: Tue, 9 Jan 2024 13:38:43 -0500 Subject: [PATCH] Add `problems` value to `dotnet package search` JSON output (#13133) --- accepted/2023/Add-dotnet-search.md | 71 +++++++++++++++++++++++------- 1 file changed, 54 insertions(+), 17 deletions(-) diff --git a/accepted/2023/Add-dotnet-search.md b/accepted/2023/Add-dotnet-search.md index 884ff1435..0f98a32d1 100644 --- a/accepted/2023/Add-dotnet-search.md +++ b/accepted/2023/Add-dotnet-search.md @@ -80,24 +80,61 @@ This option will allow the specification of the output format. The option will t - Owners - TotalDownloads - The output will take the following format - - [ - { - "source": "source Name1", - "packages": [ - { - "Owners": "", - "totalDownloads": "", - "latestVersion": "", - "id": "" - } - ] - }, - { - "source": "source Name2",... - } + The output will take the following format. + + { + "version": 1, + "problems": [ + { + "level": "error", + "text": "An error occurred!" + } + ], + "searchResult": [ + { + "source": "source Name1", + "problems": [ + { + "level": "error", + "text": "An error occurred!" + } + ], + "packages": [ + { + "Owners": "", + "totalDownloads": "", + "latestVersion": "", + "id": "" + } + ] + }, + { + "source": "source Name2", + "problems": [ + { + "level": "error", + "text": "An error occurred!" + } + ], + "packages": [ + { + "Owners": "", + "totalDownloads": "", + "latestVersion": "", + "id": "" + } + ] + },... ] + } + +##### Error Handling + +The `problems` section captures and reports issues, and it appears in two contexts: globally for the command and individually for each source. `problems` has two sections: `level` and `text`. Whether a problem is an error or a warning is presented in `level`. And the message describing the problem is presented in `text`. + +- **Global Problems**: Here, `problems` detail issues that prevent the command from proceeding. These are critical errors that affect the entire operation. +- **Source-Specific Problems**: Within each source, `problems` identify issues related only to that source. These might include source errors, or other source-specific issues." + #### Option `--verbosity`