Skip to content

UrlDiscoveryPlugin: emit strict JSON from JsonReporter - #2086

Open
waldekmastykarz wants to merge 1 commit into
dotnet:mainfrom
waldekmastykarz:urldiscoveryplugin-strict-json
Open

waldekmastykarz wants to merge 1 commit into
dotnet:mainfrom
waldekmastykarz:urldiscoveryplugin-strict-json

Conversation

@waldekmastykarz

Copy link
Copy Markdown
Collaborator

Resolves #2076

Changes

  • UrlDiscoveryPluginReport now uses the .json extension and ToJson() returns { "urlsToWatch": [...] } (serialized by JsonReporter) instead of a hand-built string with // tutorial comments. The output can be consumed directly with JSON.parse/jq and matches every other plugin's JSON report.
  • The wildcard/exclusion guidance stays in the Markdown and plain-text reports.
  • Tests: JsonReporterTests gets a test asserting the UrlDiscovery report is strict JSON with .json extension; the per-report extension regression test (JsonReporter writes .jsonc for reports after a UrlDiscovery report #1965) now uses a test report with a custom extension.

Breaking-ish: the JsonReporter output file is renamed from UrlDiscoveryPlugin_JsonReporter.jsonc to UrlDiscoveryPlugin_JsonReporter.json and no longer contains comments. The object shape (urlsToWatch array) is unchanged, so it's still paste-ready into a config.

JsonReporter now writes UrlDiscoveryPlugin_JsonReporter.json containing
{ "urlsToWatch": [...] } instead of a commented .jsonc file, so it can be
consumed with JSON.parse/jq. The wildcard/exclusion guidance remains in
the Markdown and plain-text reports.

Closes dotnet#2076

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@waldekmastykarz
waldekmastykarz requested a review from a team as a code owner November 5, 2026 10:42
Copilot AI balanced review requested due to automatic review settings November 5, 2026 10:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the URL discovery reporting changes.

No open issues 🎉

What changed in this PR

Updates URL discovery reports to produce strict JSON that tools such as JSON.parse and jq can consume directly, while retaining wildcard and exclusion guidance in Markdown and plain-text reports.

Changes:

  • Returns a serializable urlsToWatch object and changes the JSON report extension from .jsonc to .json.
  • Adds strict-JSON coverage and preserves the per-report extension regression test using a custom report.
File Description
DevProxy.Plugins/​Reporting/​UrlDiscoveryPluginReport.cs Replaces hand-built JSON with a serializable object and uses .json.
DevProxy.Integration.Tests/​JsonReporterTests.cs Verifies strict JSON output, URL values, and independent report extensions.

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UrlDiscoveryPlugin: produce strict JSON via JsonReporter

2 participants