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

chore(webapi): Swagger punctuation clean-up #1351

Merged
merged 4 commits into from
Oct 25, 2024
Merged

Conversation

oskogstad
Copy link
Collaborator

@oskogstad oskogstad commented Oct 25, 2024

Summary by CodeRabbit

  • Documentation Improvements

    • Enhanced clarity of XML documentation comments across various classes by adding periods to the end of sentences.
    • Corrected minor typographical errors in documentation comments for several properties.
  • Code Cleanup

    • Removed unused import statements in multiple files to streamline the codebase.
  • Configuration Updates

    • Adjusted logging and application configuration settings in the main program files to maintain effective startup processes.

@oskogstad oskogstad requested a review from a team as a code owner October 25, 2024 13:30
Copy link
Contributor

coderabbitai bot commented Oct 25, 2024

📝 Walkthrough

Walkthrough

This pull request includes a series of updates primarily focused on enhancing documentation consistency across various classes and schemas. The changes involve adding periods to the end of sentences in XML documentation comments and JSON schema descriptions to ensure uniformity. Additionally, there are minor adjustments to comment typographical errors and improvements in handling null values within specific converter classes. The overall structure and functionality of the affected classes and schemas remain unchanged.

Changes

File Path Change Summary
docs/schema/V1/swagger.verified.json Updated descriptions to add periods for consistency.
src/Digdir.Domain.Dialogporten.Application/Features/V1/Common/Content/ContentValueDto.cs Added period to the Value property documentation comment.
src/Digdir.Domain.Dialogporten.Application/Features/V1/Common/Content/DialogContentInputConverter.cs Corrected comment typo and improved null handling in Convert methods.
src/Digdir.Domain.Dialogporten.Application/Features/V1/Common/Content/TransmissionContentInputConverter.cs Corrected typo in comment.
src/Digdir.Domain.Dialogporten.Application/Features/V1/Common/Localizations/LocalizationDto.cs Added periods to Value and LanguageCode property comments.
src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Get/GetDialogTransmissionDto.cs Added period to IsAuthorized property comment.
src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Search/SearchDialogTransmissionDto.cs Added period to IsAuthorized property comment.
src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Get/GetDialogDto.cs Added periods to multiple property comments for consistency.
src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogDto.cs Updated comments for punctuation and simplified language.
src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Create/CreateDialogDto.cs Added periods to various property comments.
src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogDto.cs Added periods to Content, Attachments, and Action property comments.
src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Get/GetDialogDto.cs Added periods to multiple property comments for consistency.
src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/SearchDialogDto.cs Updated comments for punctuation and simplified language.
src/Digdir.Domain.Dialogporten.GraphQL/Program.cs Removed unused import statement; maintained existing logging and configuration logic.
src/Digdir.Domain.Dialogporten.Infrastructure/Altinn/Authorization/AltinnAuthorizationClient.cs Refined internal logic, added flatten parameter to GetAuthorizedParties method.
src/Digdir.Domain.Dialogporten.Infrastructure/HealthChecks/RedisHealthCheck.cs Removed unused namespaces; functionality remains unchanged.
src/Digdir.Domain.Dialogporten.Service/Program.cs Removed unused import statement; maintained existing application setup and configuration logic.
tests/Digdir.Domain.Dialogporten.Application.Unit.Tests/Features/V1/Common/Extensions/ClaimsPrincipalExtensionsTests.cs Updated ClaimsIdentity instantiation syntax in tests.

Possibly related PRs

Suggested reviewers

  • MagnusSandgren

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
25.9% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

🧹 Outside diff range and nitpick comments (1)
src/Digdir.Domain.Dialogporten.Application/Features/V1/Common/Content/DialogContentInputConverter.cs (1)

13-16: Consider addressing the TODO comment.

There's a TODO comment indicating this implementation needs team discussion. Since this PR touches documentation, it might be a good opportunity to schedule that discussion and potentially remove or update this TODO.

Would you like me to create a GitHub issue to track this TODO for team discussion?

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between e3d53ca and 21d398d.

📒 Files selected for processing (20)
  • docs/schema/V1/swagger.verified.json (55 hunks)
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/Common/Content/ContentValueDto.cs (1 hunks)
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/Common/Content/DialogContentInputConverter.cs (1 hunks)
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/Common/Content/TransmissionContentInputConverter.cs (1 hunks)
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/Common/Localizations/LocalizationDto.cs (1 hunks)
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Get/GetDialogTransmissionDto.cs (1 hunks)
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Search/SearchDialogTransmissionDto.cs (1 hunks)
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Get/GetDialogDto.cs (8 hunks)
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogDto.cs (2 hunks)
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogDtoBase.cs (3 hunks)
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Create/CreateDialogDto.cs (11 hunks)
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogDto.cs (5 hunks)
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Get/GetDialogDto.cs (9 hunks)
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/SearchDialogDto.cs (2 hunks)
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/SearchDialogDtoBase.cs (3 hunks)
  • src/Digdir.Domain.Dialogporten.GraphQL/Program.cs (0 hunks)
  • src/Digdir.Domain.Dialogporten.Infrastructure/Altinn/Authorization/AltinnAuthorizationClient.cs (0 hunks)
  • src/Digdir.Domain.Dialogporten.Infrastructure/HealthChecks/RedisHealthCheck.cs (0 hunks)
  • src/Digdir.Domain.Dialogporten.Service/Program.cs (0 hunks)
  • tests/Digdir.Domain.Dialogporten.Application.Unit.Tests/Features/V1/Common/Extensions/ClaimsPrincipalExtensionsTests.cs (3 hunks)
💤 Files with no reviewable changes (4)
  • src/Digdir.Domain.Dialogporten.GraphQL/Program.cs
  • src/Digdir.Domain.Dialogporten.Infrastructure/Altinn/Authorization/AltinnAuthorizationClient.cs
  • src/Digdir.Domain.Dialogporten.Infrastructure/HealthChecks/RedisHealthCheck.cs
  • src/Digdir.Domain.Dialogporten.Service/Program.cs
✅ Files skipped from review due to trivial changes (14)
  • docs/schema/V1/swagger.verified.json
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/Common/Content/ContentValueDto.cs
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/Common/Content/TransmissionContentInputConverter.cs
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/Common/Localizations/LocalizationDto.cs
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Get/GetDialogTransmissionDto.cs
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/DialogTransmissions/Queries/Search/SearchDialogTransmissionDto.cs
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Get/GetDialogDto.cs
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogDto.cs
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/EndUser/Dialogs/Queries/Search/SearchDialogDtoBase.cs
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Create/CreateDialogDto.cs
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Commands/Update/UpdateDialogDto.cs
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Get/GetDialogDto.cs
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/SearchDialogDto.cs
  • src/Digdir.Domain.Dialogporten.Application/Features/V1/ServiceOwner/Dialogs/Queries/Search/SearchDialogDtoBase.cs
🔇 Additional comments (2)
tests/Digdir.Domain.Dialogporten.Application.Unit.Tests/Features/V1/Common/Extensions/ClaimsPrincipalExtensionsTests.cs (1)

12-14: Modern collection initializer syntax looks good!

The update to use collection initializer syntax [] instead of new[] makes the code more concise while maintaining readability. This syntax was introduced in C# 12.

Let's verify the project's C# language version to ensure compatibility:

Consider updating similar array initializations across the codebase to maintain consistency. I can help identify other occurrences if you'd like.

Also applies to: 28-30, 44-47

✅ Verification successful

Modern collection initializer syntax is compatible and safe to use

The project uses .NET 8.0 (SDK version 8.0.403) as specified in global.json and Directory.Build.props, which fully supports C# 12 features including the collection initializer syntax []. The analysis of project files confirms this is a safe and appropriate modernization.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if the project supports C# 12 features
# Look for language version in project file or global.json

# Find all relevant project configuration files
fd -e csproj -e json . --exec grep -l "LangVersion\|languageVersion"

Length of output: 70


Script:

#!/bin/bash
# Let's try a different approach to find project files and check their content
# First, find all csproj files
fd -e csproj . | while read -r file; do
    echo "=== $file ==="
    cat "$file"
done

# Also check Directory.Build.props if it exists
if [ -f "Directory.Build.props" ]; then
    echo "=== Directory.Build.props ==="
    cat "Directory.Build.props"
fi

# Check global.json if it exists
if [ -f "global.json" ]; then
    echo "=== global.json ==="
    cat "global.json"
fi

Length of output: 34941

src/Digdir.Domain.Dialogporten.Application/Features/V1/Common/Content/DialogContentInputConverter.cs (1)

14-14: LGTM: Documentation improvement aligns with PR objectives.

The addition of proper sentence structure in the documentation comment is consistent with the PR's goal of cleaning up documentation.

@oskogstad oskogstad merged commit 866eaae into main Oct 25, 2024
23 of 24 checks passed
@oskogstad oskogstad deleted the chore/more-clean-sharply branch October 25, 2024 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants