Skip to content

Commit

Permalink
chore: Manually set operationId of Patch (#1410)
Browse files Browse the repository at this point in the history
<!--- Provide a general summary of your changes in the Title above -->


<!--- Describe your changes in detail -->

## 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)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## 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.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Amund Myrbostad <[email protected]>
  • Loading branch information
Fargekritt and Fargekritt authored Nov 7, 2024
1 parent 8d0a7b3 commit e79dbfa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/schema/V1/swagger.verified.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -51,6 +52,7 @@ public PatchDialogsController(ISender sender, IMapper mapper)
/// <response code="422">Domain error occured. See problem details for a list of errors.</response>
[HttpPatch("{dialogId}")]

[OpenApiOperation("V1ServiceOwnerDialogsPatchDialog")]
[ProducesResponseType(typeof(void), StatusCodes.Status204NoContent)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
Expand Down

0 comments on commit e79dbfa

Please sign in to comment.