From e79dbfa590725c9da413557ac21ef49ba22079a6 Mon Sep 17 00:00:00 2001 From: Amund Date: Thu, 7 Nov 2024 08:21:52 +0100 Subject: [PATCH] chore: Manually set operationId of Patch (#1410) ## Related Issue(s) - #{issue number} ## Verification - [ ] **Your** code builds clean without any errors or warnings - [ ] Manual testing done (required) - [ ] Relevant automated test added (if you find this hard, leave it and we'll help out) ## Documentation - [ ] Documentation is updated (either in `docs`-directory, Altinnpedia or a separate linked PR in [altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if applicable) ## Summary by CodeRabbit - **New Features** - Enhanced OpenAPI specification for the Dialogporten API with new schemas for managing dialogs and their activities. - Improved clarity in endpoint operations with updated operation IDs for various dialog-related actions. - **Bug Fixes** - Enhanced error handling for dialog updates, ensuring appropriate HTTP responses. - **Documentation** - Expanded descriptions for endpoints and schemas to improve usability and understanding of the API. --------- Co-authored-by: Amund Myrbostad --- docs/schema/V1/swagger.verified.json | 2 +- .../V1/ServiceOwner/Dialogs/Patch/PatchDialogsController.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/schema/V1/swagger.verified.json b/docs/schema/V1/swagger.verified.json index f21ef98b5..5f481c350 100644 --- a/docs/schema/V1/swagger.verified.json +++ b/docs/schema/V1/swagger.verified.json @@ -6501,7 +6501,7 @@ }, "patch": { "description": "Patches a dialog aggregate with a RFC6902 JSON Patch document. The patch document must be a JSON array of RFC6902 operations.\nSee [https://tools.ietf.org/html/rfc6902](https://tools.ietf.org/html/rfc6902) for more information.\n \nOptimistic concurrency control is implemented using the If-Match header. Supply the Revision value from the GetDialog endpoint to ensure that the dialog is not modified/deleted by another request in the meantime.", - "operationId": "PatchDialogs_Patch", + "operationId": "V1ServiceOwnerDialogsPatchDialog", "parameters": [ { "in": "path", diff --git a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Patch/PatchDialogsController.cs b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Patch/PatchDialogsController.cs index bb71709d8..96906a286 100644 --- a/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Patch/PatchDialogsController.cs +++ b/src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Patch/PatchDialogsController.cs @@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.JsonPatch; using Microsoft.AspNetCore.Mvc; +using NSwag.Annotations; using DialogportenAuthorizationPolicy = Digdir.Domain.Dialogporten.WebApi.Common.Authorization.AuthorizationPolicy; using IMapper = AutoMapper.IMapper; using ProblemDetails = FastEndpoints.ProblemDetails; @@ -51,6 +52,7 @@ public PatchDialogsController(ISender sender, IMapper mapper) /// Domain error occured. See problem details for a list of errors. [HttpPatch("{dialogId}")] + [OpenApiOperation("V1ServiceOwnerDialogsPatchDialog")] [ProducesResponseType(typeof(void), StatusCodes.Status204NoContent)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)] [ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]