-
Notifications
You must be signed in to change notification settings - Fork 3
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(webi): Add missing type on ETag response headers #1666
fix(webi): Add missing type on ETag response headers #1666
Conversation
📝 WalkthroughWalkthroughThis pull request enhances the OpenAPI specification and API documentation for the Dialogporten API by adding detailed Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/Digdir.Domain.Dialogporten.WebApi/OpenApiDocumentExtensions.cs (1)
8-25
: LGTM! Good solution for handling FastEndpoints-specific header titles.Consider improving readability by breaking down the LINQ query:
public static void RemoveSystemStringHeaderTitles(this OpenApiDocument openApiDocument) { const string systemString = "System_String"; - var headers = openApiDocument.Paths - .SelectMany(path => path.Value - .SelectMany(operation => operation.Value.Responses - .SelectMany(response => response.Value.Headers - .Where(header => header.Value.Schema.Title == systemString)))); + var headers = from path in openApiDocument.Paths + from operation in path.Value + from response in operation.Value.Responses + from header in response.Value.Headers + where header.Value.Schema.Title == systemString + select header; foreach (var header in headers) { header.Value.Schema.Title = null; } }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
docs/schema/V1/swagger.verified.json
(6 hunks)src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/Common/Headers/HttpResponseHeaderExamples.cs
(1 hunks)src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Patch/PatchDialogsController.cs
(1 hunks)src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Patch/ProducesResponseHeaderAttribute.cs
(1 hunks)src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Patch/ProducesResponseHeaderOperationProcessor.cs
(2 hunks)src/Digdir.Domain.Dialogporten.WebApi/OpenApiDocumentExtensions.cs
(1 hunks)src/Digdir.Domain.Dialogporten.WebApi/Program.cs
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/Common/Headers/HttpResponseHeaderExamples.cs
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build / build-and-test
🔇 Additional comments (5)
src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Patch/ProducesResponseHeaderAttribute.cs (1)
8-15
: LGTM! Well-structured enhancement to support OpenAPI documentation.The changes appropriately extend the attribute to support examples and types while maintaining backward compatibility through optional parameters.
Also applies to: 21-23
src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Patch/ProducesResponseHeaderOperationProcessor.cs (1)
25-29
: LGTM! Clean implementation of header schema and example processing.The changes correctly utilize the new attribute properties to enhance OpenAPI documentation.
src/Digdir.Domain.Dialogporten.WebApi/Endpoints/V1/ServiceOwner/Dialogs/Patch/PatchDialogsController.cs (1)
63-63
: LGTM! Good example of ETag header documentation.The example UUID follows RFC 4122 format and provides clear documentation for API consumers.
src/Digdir.Domain.Dialogporten.WebApi/Program.cs (1)
217-217
: LGTM! Documentation cleanup for string-type headersThe addition of
RemoveSystemStringHeaderTitles()
improves the OpenAPI specification by removing redundant type information from string headers like ETag.docs/schema/V1/swagger.verified.json (1)
5869-5873
: LGTM! Consistent ETag header documentation across endpointsThe OpenAPI specification has been enhanced with proper ETag header documentation for all dialog-modifying endpoints. The changes:
- Add clear descriptions indicating the ETag is a UUID
- Include consistent example values
- Specify the correct schema type
- Follow OpenAPI best practices
Also applies to: 5947-5951, 6112-6116, 6216-6220, 6523-6527, 6895-6899
Quality Gate passedIssues Measures |
🤖 I have created a release *beep* *boop* --- ## [1.44.2](v1.44.1...v1.44.2) (2025-01-08) ### Bug Fixes * **webi:** Add missing type on ETag response headers ([#1666](#1666)) ([df559ed](df559ed)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Description
Related Issue(s)
Verification
Documentation
docs
-directory, Altinnpedia or a separate linked PR in altinn-studio-docs., if applicable)