Skip to content
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

Fix swagger schema error after #15946 #15971

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

kjac
Copy link
Contributor

@kjac kjac commented Apr 2, 2024

Prerequisites

  • I have added steps to test this contribution in the description below

Description

Following the merge of #15946 the Swagger schema generation reports this error:

An unhandled exception has occurred while executing the request.
Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorException: Failed to generate Operation for action - Umbraco.Cms.Api.Management.Controllers.DocumentVersion.ByKeyDocumentVersionController.ByKey (Umbraco.Cms.Api.Management). See inner exception
 ---> Swashbuckle.AspNetCore.SwaggerGen.SwaggerGeneratorException: Failed to generate schema for type - Umbraco.Cms.Api.Management.ViewModels.Document.DocumentVersionResponseModel. See inner exception
 ---> System.InvalidOperationException: Can't use schemaId "$ContentForDocumentResponseModel" for type "$Umbraco.Cms.Api.Management.ViewModels.Content.ContentResponseModelBase`2[Umbraco.Cms.Api.Management.ViewModels.Document.DocumentValueModel,Umbraco.Cms.Api.Management.View
Models.Document.DocumentVariantResponseModel]". The same schemaId is already used for type "$Umbraco.Cms.Api.Management.ViewModels.Document.DocumentResponseModelBase`2[Umbraco.Cms.Api.Management.ViewModels.Document.DocumentValueModel,Umbraco.Cms.Api.Management.ViewModels.Document.DocumentVariantResponseModel]"

This PR fixes it.

Testing this PR

  1. Verify that the Swagger doc can load.
  2. Test that the document versioning endpoints from Document version endpoints #15946 still work.

@Migaroez Migaroez merged commit 06cfec2 into v14/dev Apr 3, 2024
17 checks passed
@Migaroez Migaroez deleted the v14/fix/swagger-error-after-15946 branch April 3, 2024 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants