Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

409
Visualizações
Moshi: When is Reflection needed?

Currently using Moshi with Retrofit but need to look back as I noticed I am not implementing it right and confused when to add kotlin-reflect in the dependencies.

According to README

The reflection adapter requires the following additional dependency:

implementation("com.squareup.moshi:moshi-kotlin:1.13.0")

I thought the above dependency is the actual Moshi dependency but it seems it is not needed unless you are using KotlinJsonAdapterFactory. What is KotlinJsonAdapterFactory anyway, is it responsible for converting Kotlin classes to JSON?

Currently I have this dependencies and annotation processor.

   implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"

    // Retrofit 2 + Moshi
    ksp 'com.squareup.moshi:moshi-kotlin-codegen:1.12.0'
    implementation 'com.squareup.moshi:moshi-kotlin:1.12.0'
    implementation 'com.squareup.retrofit2:converter-moshi:2.9.0'

If I will be using Moshi with Codegen only, can I remove the others and ended up on just these two dependency?

    ksp 'com.squareup.moshi:moshi-kotlin-codegen:1.12.0'
    implementation 'com.squareup.retrofit2:converter-moshi:2.9.0'
over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda