Add openapi support#1146
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds OpenAPI document generation for the Netclaw daemon and updates multiple Minimal API endpoints to use TypedResults + named/tagged operations so OpenAPI clients (e.g., Refitter) can be generated reliably.
Changes:
- Register and expose an OpenAPI document endpoint (
AddOpenApi/MapOpenApi). - Convert several endpoints to typed
Results<...>return types and replace anonymous JSON payloads with explicit request/response records. - Add OpenAPI metadata (
WithName,WithSummary,WithTags) across the daemon API surface.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Netclaw.Daemon/Webhooks/WebhookEndpointRouteBuilderExtensions.cs | Convert webhook endpoint to typed results + explicit response DTOs and add OpenAPI metadata. |
| src/Netclaw.Daemon/Security/PairingEndpointRouteBuilderExtensions.cs | Convert pairing endpoints to typed results + explicit response DTOs and add OpenAPI metadata. |
| src/Netclaw.Daemon/Reminders/ReminderEndpointRouteBuilderExtensions.cs | Convert reminder endpoints to typed results + explicit DTOs and add OpenAPI metadata. |
| src/Netclaw.Daemon/Providers/ProviderOAuthEndpointRouteBuilderExtensions.cs | Add typed query/response models and OpenAPI metadata for provider OAuth endpoints. |
| src/Netclaw.Daemon/Mcp/McpEndpointRouteBuilderExtensions.cs | Add typed query/response models, typed results, and OpenAPI metadata for MCP endpoints. |
| src/Netclaw.Daemon/Lifecycle/LifecycleEndpointRouteBuilderExtensions.cs | Add typed query/response models, typed results, and OpenAPI metadata for lifecycle shutdown endpoint. |
| src/Netclaw.Daemon/Configuration/MattermostActionEndpointExtensions.cs | Convert Mattermost callback endpoint to typed results and add OpenAPI metadata. |
| src/Netclaw.Daemon/Program.cs | Register OpenAPI services and map OpenAPI endpoint; add OpenAPI metadata to health/stats endpoints. |
| src/Netclaw.Daemon/Netclaw.Daemon.csproj | Enable XML doc generation and suppress doc-comment diagnostics to support OpenAPI metadata. |
| Directory.Packages.props | Add central package version for Microsoft.AspNetCore.OpenApi. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Adds OpenAPI support, including updating Minimal API Endpoints to use TypedResults. This will facilitate letting agents interact with the API directly, including autogenerating an API client using Refitter for the Management UI.
OpenAPI document will be available at
http://localhost:5199/openapi/v1.jsonNOTE: I added warnings to the ignore list for the Daemon - these pop up because the default warning for public types when generating docs is very strict. I personally don't like this to be a warning or a failure, but happy to defer to you here.
Sample of what this looks like:
