Package

com.twitter.finatra.jackson

modules

Permalink

package modules

Visibility
  1. Public
  2. All

Type Members

  1. class ScalaObjectMapperModule extends TwitterModule

    Permalink

    TwitterModule to configure Jackson object mappers.

    TwitterModule to configure Jackson object mappers. Extend this module to override defaults or provide additional configuration to the bound ScalaObjectMapper instances.

    Example:

    import com.fasterxml.jackson.databind.{
      DeserializationFeature,
      Module,
      ObjectMapper,
      PropertyNamingStrategy
    }
    import com.twitter.finatra.jackson.modules.ScalaObjectMapperModule
    
    object MyCustomObjectMapperModule extends ScalaObjectMapperModule {
    
      override val propertyNamingStrategy: PropertyNamingStrategy =
        new PropertyNamingStrategy.KebabCaseStrategy
    
      override val additionalJacksonModules: Seq[Module] =
        Seq(MySimpleJacksonModule)
    
      override def additionalMapperConfiguration(mapper: ObjectMapper): Unit = {
        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true)
       }
     }

Ungrouped