Skip to content

Replace Swashbuckle#3179

Draft
gunndabad wants to merge 2 commits intomainfrom
openapi
Draft

Replace Swashbuckle#3179
gunndabad wants to merge 2 commits intomainfrom
openapi

Conversation

@gunndabad
Copy link
Copy Markdown
Member

@gunndabad gunndabad commented Feb 27, 2026

Replaces Swashbuckle with Microsoft.AspNetCore.OpenApi and Scalar for a UI.

This also uses the new-ish webhooks element of OpenAPI for defining our webhook messages.

There are a few places where schema generation is broken (Option<T>, OneOf<T1, T2> etc.) - I'll deal with these separately; they're somewhat broken today any way.

I've also added redirects from the API root to the UI, since folks aren't discovering the docs at /swagger, even though it is called out in the docs.

@gunndabad
Copy link
Copy Markdown
Member Author

@copilot replace the SwaggerOperation attributes in the API project with EndpointName, EndpointSummary and EndpointDescription. See GetIttProvidersAsync() in TeachingRecordSystem.Api.V2.Controllers.IttProvidersController for an example.

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 27, 2026

@gunndabad I've opened a new pull request, #3180, to work on those changes. Once the pull request is ready, I'll request review from you.

Completes the Swashbuckle removal by replacing remaining Swashbuckle
annotation attributes in API controllers and request models with native
ASP.NET Core equivalents.

### Changes

- **`[SwaggerOperation]`** → `[EndpointName]`, `[EndpointSummary]`,
`[EndpointDescription]` on all action methods across V1, V2, and V3
controllers
- **`[SwaggerParameter]`** → `[Description]` (`System.ComponentModel`)
on action method parameters
- **`[SwaggerSchema]`** → `[Description]` (`System.ComponentModel`) on
request model properties

### Before / After

```csharp
// Before
[SwaggerOperation(
    OperationId = "GetIttProviders",
    Summary = "Get ITT Providers",
    Description = "Gets the list of ITT providers")]

// After
[EndpointName("GetIttProviders"),
    EndpointSummary("Get ITT Providers"),
    EndpointDescription("Gets the list of ITT providers")]
```

### Guidance to review

34 files changed; all are mechanical attribute substitutions. No logic
changes.

### Checklist

-   [ ] Attach to Trello card
-   [ ] Rebased master
-   [ ] Cleaned commit history
-   [ ] Tested by running locally

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for
you](https://github.com/DFE-Digital/teaching-record-system/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: gunndabad <2041280+gunndabad@users.noreply.github.com>
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.

2 participants