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

158
Visualizações
How to migrate some route DTO object in NestJ?

I use NestJS and my app have some changes in the DTO objects that is expects to receive in the controller. The client side is a mobile app and I can’t force the users to update version, so I might get DTO objects that might not be in the updated version that my server side expects to receive.

What I want to do is to take the object I get and if I see the object is received from older version of the client side then I want this object to be migrated to the updated object type.

What is the best approach to do this?

Thanks in advance!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

A simple solution can be adding a field that indicates that the recived object is the DTO's updated version, check if that field exist or not, then apply the consequent logic.

Another way is to use the API versioning, you can find how to use it in the NestJS official documentation. This one I think is a better approach, this because if in the future you want to update again the DTO, you have only to create another controller version.

about 4 years ago · Juan Pablo Isaza Relatório
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