Skip to content

devproxy api show: include request body and query parameters for each endpoint - #2092

Open
waldekmastykarz wants to merge 1 commit into
dotnet:mainfrom
waldekmastykarz:api-show-request-body-query-params
Open

waldekmastykarz wants to merge 1 commit into
dotnet:mainfrom
waldekmastykarz:api-show-request-body-query-params

Conversation

@waldekmastykarz

Copy link
Copy Markdown
Collaborator

Resolves #2065

devproxy api show now lists the input each endpoint expects, so agents don't have to guess the POST /proxy body or miss the required format query on /proxy/rootCertificate.

Text output:

  GET    /proxy                         Get proxy status
  POST   /proxy                         Update proxy status (e.g. start/stop recording)  body: {"recording": true|false}
  POST   /proxy/mockRequest             Issue a mock request
  POST   /proxy/stopProxy               Stop the proxy
  POST   /proxy/jwtToken                Create a JWT token  body: {"name": "...", "audiences": ["..."], ...} (all optional; validFor in minutes)
  GET    /proxy/rootCertificate         Get the root certificate  query: format=crt (required)
  GET    /proxy/logs                    Get proxy logs (for detached mode access)  query: lines=50&follow=true&since=5m (all optional)

JSON output (--output json) gets matching optional query and body string hints per endpoint (omitted when an endpoint takes no input).

Notes:

… endpoint

Closes dotnet#2065

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:43
Copilot AI balanced review requested due to automatic review settings November 5, 2026 10:44

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 were identified in the endpoint input-hint changes.

No open issues 🎉

What changed in this PR

Enhances devproxy api show with endpoint input hints so users and agents can discover expected request bodies and query parameters.

Changes:

  • Adds body and query hints to text output and optional body and query fields to JSON output.
  • Centralizes endpoint metadata and text formatting.
  • Adds tests for recording, certificate, and JWT hints, plus endpoints without input.
File Description
DevProxy/​Commands/​ApiCommand.cs Defines input hints and includes them in text and JSON output.
DevProxy.Tests/​ApiCommandTests.cs Tests endpoint hints and description-only formatting.

Review effort: Balanced

waldekmastykarz added a commit to waldekmastykarz/dev-proxy that referenced this pull request Nov 5, 2026
- Rename structured query field to OpenAPI 'parameters' (with in: query)
  so it doesn't collide with the 'query' hint added in dotnet#2092
- Disallow additional properties in the POST /proxy request schema
- Document 400 for invalid query values on /proxy/logs

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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.

devproxy api show: include request body and query parameters for each endpoint

2 participants