1package org.apache.archiva.redback.rest.services.interceptors;
2/*3 * Licensed to the Apache Software Foundation (ASF) under one4 * or more contributor license agreements. See the NOTICE file5 * distributed with this work for additional information6 * regarding copyright ownership. The ASF licenses this file7 * to you under the Apache License, Version 2.0 (the8 * "License"); you may not use this file except in compliance9 * with the License. You may obtain a copy of the License at10 *11 * http://www.apache.org/licenses/LICENSE-2.012 *13 * Unless required by applicable law or agreed to in writing,14 * software distributed under the License is distributed on an15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY16 * KIND, either express or implied. See the License for the17 * specific language governing permissions and limitations18 * under the License.19 */2021import org.codehaus.jackson.map.DeserializationConfig;
22import org.codehaus.jackson.map.ObjectMapper;
23import org.slf4j.Logger;
24import org.slf4j.LoggerFactory;
25import org.springframework.stereotype.Service;
2627import javax.inject.Inject;
2829/**30 * to setup some ObjectMapper configuration31 *32 * @author Olivier Lamy33 * @since 2.034 */35 @Service("redbackJacksonJsonConfigurator")
36publicclassJacksonJsonConfigurator37 {
38private Logger log = LoggerFactory.getLogger( getClass() );
3940 @Inject
41publicJacksonJsonConfigurator( ObjectMapper objectMapper )
42 {
43 log.info( "configure jackson ObjectMapper" );
44 objectMapper.configure( DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false );
45 }
46 }