-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Dependencies: Updates Swashbuckle to v10 #20925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dependencies: Updates Swashbuckle to v10 #20925
Conversation
Didn't notice that these classes were internal, so tried keeping compatibility, but it wasn't needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request upgrades Swashbuckle from v9.0.6 to v10.0.1, implementing breaking API changes from the OpenAPI library. The update modernizes the codebase to use new interface-based patterns, enum-based type definitions, and JSON node-based value representations.
Key Changes
- Namespace consolidation from
Microsoft.OpenApi.ModelstoMicrosoft.OpenApiacross all OpenAPI-related code - Migration from concrete types to interface-based types (e.g.,
IOpenApiSchema,IOpenApiParameter) with appropriate casting patterns - Schema type system updated from strings to
JsonSchemaTypeenum flags, including new nullability patterns using flag combinations - OpenAPI example values now use
JsonNodetypes instead of specializedOpenApiString/OpenApiArrayclasses - Security scheme references simplified using new
OpenApiSecuritySchemeReferenceconstructor
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Directory.Packages.props | Updated Swashbuckle.AspNetCore package version from 9.0.6 to 10.0.1 |
| templates/UmbracoExtension/Composers/UmbracoExtensionApiComposer.cs | Updated namespace import from Microsoft.OpenApi.Models to Microsoft.OpenApi |
| src/Umbraco.Web.UI.Client/src/packages/core/backend-api/types.gen.ts | Regenerated TypeScript types reflecting removed DocumentTypePermissionPresentationModel and new query parameters |
| src/Umbraco.Web.UI.Client/src/packages/core/backend-api/sdk.gen.ts | Added deprecation marker for GetHelp endpoint |
| src/Umbraco.Cms.Api.Management/OpenApi/RequireNonNullablePropertiesSchemaFilter.cs | Updated to use IOpenApiSchema interface with casting, new nullability check using JsonSchemaType flags |
| src/Umbraco.Cms.Api.Management/OpenApi/ReponseHeaderOperationFilter.cs | Migrated to interface types and JsonSchemaType enum for header schemas |
| src/Umbraco.Cms.Api.Management/OpenApi/NotificationHeaderFilter.cs | Updated notification header schema to use JsonSchemaType flags and OpenApiSchemaReference |
| src/Umbraco.Cms.Api.Management/OpenApi/BackOfficeSecurityRequirementsOperationFilterBase.cs | Simplified security scheme references using OpenApiSecuritySchemeReference constructor |
| src/Umbraco.Cms.Api.Management/OpenApi.json | Regenerated OpenAPI document with new Help endpoint, foldersOnly parameters, removed DocumentTypePermissionPresentationModel, and added tags section |
| src/Umbraco.Cms.Api.Management/Configuration/ConfigureUmbracoManagementApiSwaggerGenOptions.cs | Updated namespace and added readonly modifier to field |
| src/Umbraco.Cms.Api.Delivery/Filters/SwaggerMediaDocumentationFilter.cs | Migrated example values from OpenApiString/OpenApiArray to JsonNode types |
| src/Umbraco.Cms.Api.Delivery/Filters/SwaggerDocumentationFilterBase.cs | Updated parameter filter to use interface types with casting, migrated examples to JsonNode |
| src/Umbraco.Cms.Api.Delivery/Filters/SwaggerContentDocumentationFilter.cs | Updated header schemas to JsonSchemaType enum and migrated examples to JsonNode |
| src/Umbraco.Cms.Api.Delivery/Configuration/ConfigureUmbracoMemberAuthenticationDeliveryApiSwaggerGenOptions.cs | Updated security scheme references and added null-safety for Components collections |
| src/Umbraco.Cms.Api.Delivery/Configuration/ConfigureUmbracoDeliveryApiSwaggerGenOptions.cs | Updated namespace import |
| src/Umbraco.Cms.Api.Common/OpenApi/SwaggerRouteTemplatePipelineFilter.cs | Updated namespace and removed unused Umbraco.Extensions import |
| src/Umbraco.Cms.Api.Common/OpenApi/RemoveSecuritySchemesDocumentFilter.cs | Added null-conditional operators for safer Components access |
| src/Umbraco.Cms.Api.Common/OpenApi/MimeTypeDocumentFilter.cs | Enhanced null-safety with OfType<> filtering for interface collections |
| src/Umbraco.Cms.Api.Common/OpenApi/EnumSchemaFilter.cs | Updated to use JsonSchemaType enum and JsonNode for enum values |
| src/Umbraco.Cms.Api.Common/Configuration/ConfigureUmbracoSwaggerGenOptions.cs | Updated namespace import |
| tests/Umbraco.Tests.Integration/Umbraco.Core/DeliveryApi/OpenApiContractTest.cs | Updated test expectations to include new tags section in OpenAPI contract |
src/Umbraco.Cms.Api.Delivery/Filters/SwaggerMediaDocumentationFilter.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested out using a text file comparison and can confirm both management and delivery API Swagger JSON documents are identical apart from the additional output of a tags collection.
E.g. the delivery API has:
"tags": [
{
"name": "Content"
},
{
"name": "Media"
}
Given that's an addition rather than any change to existing JSON elements, I can't see that's a concern.
Otherwise I just addressed the Copilot comments by suggesting use of e.g. A is false over !A and A == false, which is just to align with the syntax used in more recent code updates.
src/Umbraco.Cms.Api.Management/OpenApi/ReponseHeaderOperationFilter.cs
Outdated
Show resolved
Hide resolved
src/Umbraco.Cms.Api.Management/OpenApi/RequireNonNullablePropertiesSchemaFilter.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Andy Butland <[email protected]> Co-authored-by: Copilot <[email protected]>
This pull request updates Swashbuckle to v10.
Main changes
OpenApiString,OpenApiArray, ...) these all use JsonNode now.OpenApiParameter, but now reference the interfaceIOpenApiParameterString,Object,Null, ...) and not just a simple stringIsNullableproperty anymore, in the Type you mention both types, likeType = JsonSchemaType.Array | JsonSchemaType.Null.Testing
Compare the generated Management and Delivery API swagger documents