-
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: Add missing prefixes in Swagger TypeNameConverter exlude list #1992
Conversation
📝 WalkthroughWalkthroughThis pull request applies extensive renaming and refactoring across the API documentation and client interface code. In the Swagger specification file, several schema names and operation IDs are updated (e.g., replacing "SearchTag" with "Tag" and modifying JWKS-related names). The type name conversion logic is refined by expanding excluded prefixes and streamlining methods. In the Refitter interface, classes and method signatures are renamed to remove redundant suffixes. Additionally, the old schema suffix generator is removed in favor of introducing a new short name generator, with adjustments made in the program configuration for Swagger. Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
🔇 Additional comments (1)
✨ Finishing Touches
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 (2)
src/Digdir.Domain.Dialogporten.WebApi/Common/Swagger/TypeNameConverter.cs (2)
12-12
: Expanded prefix exclusion list enhances naming consistency.The updated list of excluded prefixes now includes "Purge", "Restore", "Search", and "Get" in addition to the existing prefixes. This change improves naming consistency by removing redundant action verbs from type names when generating API documentation and client code.
This change is a good example of maintaining consistent API naming conventions. By expanding the excluded prefixes, you're ensuring more uniform type names across your API surface, which improves developer experience and code readability.
69-69
: Minor white space correction in comment.A space was removed from the comment text, improving consistency.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
docs/schema/V1/swagger.verified.json
(29 hunks)src/Digdir.Domain.Dialogporten.WebApi/Common/Swagger/TypeNameConverter.cs
(2 hunks)src/Digdir.Library.Dialogporten.WebApiClient.WebApiSample/Program.cs
(1 hunks)src/Digdir.Library.Dialogporten.WebApiClient/Features/V1/RefitterInterface.cs
(17 hunks)
🔇 Additional comments (27)
src/Digdir.Library.Dialogporten.WebApiClient.WebApiSample/Program.cs (1)
29-29
:✅ Verification successful
Method name updated to match new API naming convention.
The method call has been updated from
V1ServiceOwnerDialogsGetGetDialog
toV1ServiceOwnerDialogsGetDialog
, removing the redundant "Get" prefix. This change aligns with the expanded exclude list inTypeNameConverter.cs
.Let's check if there are any other instances of method calls that might need similar updates:
🏁 Script executed:
#!/bin/bash # Search for similar method patterns that might still have redundant prefixes rg -o "V1ServiceOwnerDialogs\w+Get\w+" --type csLength of output: 3624
Subject: Verified API Naming Consistency
The method call in src/Digdir.Library.Dialogporten.WebApiClient.WebApiSample/Program.cs was correctly updated from
V1ServiceOwnerDialogsGetGetDialog
toV1ServiceOwnerDialogsGetDialog
, removing the redundant"Get"
and aligning with the new API naming convention. In addition, a repository-wide search revealed several method patterns (e.g.V1ServiceOwnerDialogsQueriesGet_Dialog
in RefitterInterface.cs) that include"QueriesGet"
rather than a doubled"Get"
. These appear consistent with the intended naming for query methods and do not exhibit the redundant pattern seen previously.
- File Updated:
src/Digdir.Library.Dialogporten.WebApiClient.WebApiSample/Program.cs
, where the method call is now:=> Results.Ok(serviceOwnerApi.V1ServiceOwnerDialogsGetDialog(dialogId, null!, cancellationToken)));
- Additional Findings: Other instances (e.g., in
src/Digdir.Library.Dialogporten.WebApiClient/Features/V1/RefitterInterface.cs
) follow the convention for query methods correctly, with no redundant"Get"
.All instances reviewed adhere to the updated naming conventions.
src/Digdir.Library.Dialogporten.WebApiClient/Features/V1/RefitterInterface.cs (17)
16-16
: Improved class naming by removing redundant "Search" prefix.The class has been renamed from
V1ServiceOwnerDialogsSearchSearchDialogQueryParams
toV1ServiceOwnerDialogsSearchDialogQueryParams
, removing the redundant "Search" term.
207-207
: Improved method naming by removing redundant "Search" term.The method has been renamed from
V1ServiceOwnerDialogTransmissionsSearchSearchDialogTransmission
toV1ServiceOwnerDialogTransmissionsSearchDialogTransmission
, which is cleaner and more consistent.
297-297
: Improved method naming by removing redundant "Get" term.The method has been renamed from
V1ServiceOwnerDialogTransmissionsGetGetDialogTransmission
toV1ServiceOwnerDialogTransmissionsGetDialogTransmission
, which is cleaner and more consistent.
332-332
: Improved method naming by removing redundant "Search" term.The method has been renamed from
V1ServiceOwnerDialogSeenLogsSearchSearchDialogSeenLog
toV1ServiceOwnerDialogSeenLogsSearchDialogSeenLog
, which is cleaner and more consistent.
367-367
: Improved method naming by removing redundant "Get" term.The method has been renamed from
V1ServiceOwnerDialogSeenLogsGetGetDialogSeenLog
toV1ServiceOwnerDialogSeenLogsGetDialogSeenLog
, which is cleaner and more consistent.
454-454
: Improved method naming by removing redundant "Get" term.The method has been renamed from
V1ServiceOwnerDialogsGetGetDialog
toV1ServiceOwnerDialogsGetDialog
, which is cleaner and more consistent.
586-586
: Improved method naming by removing redundant "Search" term.The method has been renamed from
V1ServiceOwnerDialogsSearchSearchDialog
toV1ServiceOwnerDialogsSearchDialog
, which is cleaner and more consistent.
668-668
: Improved method naming by reducing verbosity.Method renamed to follow the established naming convention, making the interface more consistent.
707-707
: Improved method naming by reducing verbosity.Method renamed to follow the established naming convention, making the interface more consistent.
738-738
: Improved method naming by removing redundant "Search" term.The method has been renamed from
V1ServiceOwnerDialogActivitiesSearchSearchDialogActivity
toV1ServiceOwnerDialogActivitiesSearchDialogActivity
, which is cleaner and more consistent.
856-856
: Improved method naming by removing redundant "Get" term.The method has been renamed from
V1ServiceOwnerDialogActivitiesGetGetDialogActivity
toV1ServiceOwnerDialogActivitiesGetDialogActivity
, which is cleaner and more consistent.
1655-1655
: Simplified class reference by removing "Search" prefix from the Tag type.Renamed from
V1ServiceOwnerDialogsCommandsUpdate_SearchTag
toV1ServiceOwnerDialogsCommandsUpdate_Tag
for better naming conventions. The property name "SearchTags" remains unchanged, which correctly describes the purpose.
1784-1784
: Simplified class name by removing redundant "Search" prefix.Renamed the class from
V1ServiceOwnerDialogsCommandsUpdate_SearchTag
toV1ServiceOwnerDialogsCommandsUpdate_Tag
, which is more concise and follows the convention of not repeating concepts across class and property names.
2810-2810
: Simplified class reference by removing "Search" prefix from the Tag type.Renamed from
V1ServiceOwnerDialogsQueriesGet_SearchTag
toV1ServiceOwnerDialogsQueriesGet_Tag
for better naming conventions. The property name "SearchTags" remains unchanged, which correctly describes the purpose.
2965-2965
: Simplified class name by removing redundant "Search" prefix.Renamed the class from
V1ServiceOwnerDialogsQueriesGet_SearchTag
toV1ServiceOwnerDialogsQueriesGet_Tag
, which is more concise and follows the convention of not repeating concepts across class and property names.
3637-3637
: Simplified class reference by removing "Search" prefix from the Tag type.Renamed from
V1ServiceOwnerDialogsCommandsCreate_SearchTag
toV1ServiceOwnerDialogsCommandsCreate_Tag
for better naming conventions. The property name "SearchTags" remains unchanged, which correctly describes the purpose.
3745-3745
: Simplified class name by removing redundant "Search" prefix.Renamed the class from
V1ServiceOwnerDialogsCommandsCreate_SearchTag
toV1ServiceOwnerDialogsCommandsCreate_Tag
, which is more concise and follows the convention of not repeating concepts across class and property names.docs/schema/V1/swagger.verified.json (9)
2429-2429
: Improved naming consistency by simplifying schema reference.The schema reference has been updated from
V1ServiceOwnerDialogsCommandsCreate_SearchTag
toV1ServiceOwnerDialogsCommandsCreate_Tag
, removing the redundant "Search" prefix. This change is part of a broader effort to standardize naming conventions across the API specification.
3078-3078
: Improved naming consistency by simplifying schema reference.Similar to the previous change, this schema reference has been updated from
V1ServiceOwnerDialogsCommandsUpdate_SearchTag
toV1ServiceOwnerDialogsCommandsUpdate_Tag
, providing more consistent naming throughout the API.
4110-4119
: Improved naming consistency by simplifying schema definition.The schema definition has been updated from
V1ServiceOwnerDialogsQueriesGet_SearchTag
toV1ServiceOwnerDialogsQueriesGet_Tag
, maintaining the same structure but with a more concise name by removing the redundant "Search" prefix.
4826-4838
: Added structured schema definition for JWKS response.A properly structured schema definition for
V1WellKnownJwksQueriesGet_Jwks
has been added, which includes properties for handling keys. This provides better OpenAPI documentation for the JWKS endpoint response.
4871-4871
: Simplified operation ID for JWKS endpoint.The operation ID has been updated from
V1WellKnownJwksGet_GetJwks
toV1WellKnownJwksGet_Jwks
, removing the redundant "Get" prefix for better naming consistency.
4877-4877
: Updated schema reference to match new naming convention.The schema reference has been updated to use the newly defined
V1WellKnownJwksQueriesGet_Jwks
schema, ensuring consistency with the renamed operation.
4893-4893
: Simplified operation ID for OAuth authorization server endpoint.The operation ID has been updated to follow the same naming convention applied to other endpoints, removing redundant prefixes for cleaner API documentation.
4899-4899
: Updated schema reference to match new naming convention.The schema reference has been updated to maintain consistency with the renamed operation ID, ensuring that all related components use the same naming pattern.
4915-4915
: Consistent renaming of operation IDs across all endpoints.The operation IDs have been updated throughout the file to follow a more consistent naming convention, removing redundant prefixes (like "Get") from the names. This improves readability and maintains a standardized approach to naming.
Also applies to: 5164-5164, 5221-5221, 5404-5404, 5463-5463, 5621-5621, 5683-5683, 5751-5751, 5789-5789, 6235-6235, 6532-6532, 6600-6600, 6747-6747, 6928-6928, 6996-6996, 7058-7058, 7126-7126, 7310-7310
1fce871
to
2fa77a7
Compare
🤖 I have created a release *beep* *boop* --- ## [1.57.2](v1.57.1...v1.57.2) (2025-03-03) ### Bug Fixes * Add missing prefixes in Swagger TypeNameConverter exlude list ([#1992](#1992)) ([88925c1](88925c1)) * **ci:** Wait for infra deployment before deploying apps in prod pipeline ([#1989](#1989)) ([224e837](224e837)) ### Miscellaneous Chores * **performance:** Make improved tests for search ([#1983](#1983)) ([9412a85](9412a85)) --- 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)