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

Refactor the ExtensionRepoService to use DTOs #573

Merged
merged 2 commits into from
Mar 23, 2024

Commits on Mar 23, 2024

  1. Refactor the ExtensionRepoService to use DTOs

    Slightly refactored the `ExtensionRepoService` so it uses a DTO with
    `parseAs` to avoid parsing the JSON response by hand.
    
    The default Json instance Injekt provides here has
    `ignoreUnknownKeys` enabled, so the `ExtensionRepoMetaDto` only
    specifies the meta key of the response content.
    
    The extension function `toExtensionRepo` allows for mapping the new
    DTO to the `domain` `ExtensionRepo` data class.
    MajorTanya committed Mar 23, 2024
    Configuration menu
    Copy the full SHA
    ebc7215 View commit details
    Browse the repository at this point in the history
  2. Implement feedback

    - Removed SerialName of the ExtensionRepoMetaDto property and renamed
    it `meta`, same as the incoming attribute.
    - Added a more general catch clause that also logs the occurring
    Exception
    
    Detekt likes to complain about TooGenericExceptionCaught, hence the
    Suppress annotation on the function.
    MajorTanya committed Mar 23, 2024
    Configuration menu
    Copy the full SHA
    8b3bb53 View commit details
    Browse the repository at this point in the history