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

440
Visualizações
Jackson module with @JsonProperty defaultValue handling

I am using spring boot with jackson to create a rest api. I know that @JsonProperty annotation has defaultValue field. In it's javadoc its said:

textual default value defined as metadata. NOTE: core databind does NOT make any use of this value; it is currently only exposed to extension modules.

So I found some modules for jackson on maven central repository, however I couldn't find anyware information about which extension I should use to enable defaultValue handling.

Is there such module?

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

As per the documentations of JsonProperty , the defaultValue property may be used to document expected default value. They have added this property in version 2.5. And as per their view

It is possible that in future this annotation could be used for value defaulting, and especially for default values of Creator properties,since they support {@link #required()} in 2.6 and above.

As of now till version 2.8 we are not able to use this annotation to set default value. Here we may rely on Java to have default values for member variables.

about 4 years ago · Santiago Trujillo 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