标签:esc ble color getconf new sele on() type rate
Unrecognized field "xxx" (……), not marked as ignorable (5 known properties: "xxxxxxxxx",
反序列化字段未匹配上,忽略掉这些字段:
public class JsonUtil {
public static final ObjectMapper objectMapper;
static {
objectMapper = new ObjectMapper();
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
}
}
@Profile("dev") //指定只可以在dev环境看到接口doc
@Configuration @EnableSwagger2 @Profile("dev") @ComponentScan("com.xxx.xxx.controller") public class SwaggerConfig { @Bean public Docket createRestApi() { return new Docket(DocumentationType.SWAGGER_2) .apiInfo(apiInfo()) .select() .apis(RequestHandlerSelectors.basePackage("com.xxx.controller")) .paths(PathSelectors.any()) .build(); } private ApiInfo apiInfo() { ApiInfo apiInfo = new ApiInfoBuilder().title("Service APIs") .description("Service APIs") .license("xxx") .licenseUrl("http://www.xxx.com") .version("1.0") .build(); return apiInfo; } }
private ModelMapper mapper; /** * init mapper */ public DemoController() { this.mapper = new ModelMapper(); this.mapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT); }
标签:esc ble color getconf new sele on() type rate
原文地址:http://www.cnblogs.com/mr-yang-localhost/p/7709759.html