@Override public Boolean findIgnoreUnknownProperties(AnnotatedClass ac) { JsonIgnoreProperties ignore = ac.getAnnotation(JsonIgnoreProperties.class); return (ignore == null) ? null : ignore.ignoreUnknown(); }
@Override public Boolean findIgnoreUnknownProperties(AnnotatedClass ac) { JsonIgnoreProperties ignore = ac.getAnnotation(JsonIgnoreProperties.class); return (ignore == null) ? null : ignore.ignoreUnknown(); }
@Override public Boolean findIgnoreUnknownProperties(AnnotatedClass ac) { JsonIgnoreProperties ignore = ac.getAnnotation(JsonIgnoreProperties.class); return (ignore == null) ? null : ignore.ignoreUnknown(); }
@Override public Boolean findIgnoreUnknownProperties(AnnotatedClass ac) { JsonIgnoreProperties ignore = ac.getAnnotation(JsonIgnoreProperties.class); return (ignore == null) ? null : ignore.ignoreUnknown(); }
@Override public Boolean findIgnoreUnknownProperties(AnnotatedClass ac) { JsonIgnoreProperties ignore = ac.getAnnotation(JsonIgnoreProperties.class); return (ignore == null) ? null : ignore.ignoreUnknown(); }
@Override public Boolean findIgnoreUnknownProperties(AnnotatedClass ac) { JsonIgnoreProperties ignore = ac.getAnnotation(JsonIgnoreProperties.class); return (ignore == null) ? null : ignore.ignoreUnknown(); }
@Override public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterator<ModelConverter> chain) { if (chain.hasNext()) { Schema schema = chain.next().resolve(type, context, chain); if (schema != null) { if (!Strings.isNullOrEmpty(schema.get$ref())) { Schema schemaToFix = context.getDefinedModels().get(SchemaUtil.getSchemaNameFromRef(schema)); if (schemaToFix.getAdditionalProperties() == null) { final JavaType javaType = mapper.constructType(type.getType()); final BeanDescription beanDesc = mapper.getSerializationConfig().introspect(javaType); JsonIgnoreProperties ignoreProperties = beanDesc.getClassAnnotations().get(JsonIgnoreProperties.class); if (ignoreProperties != null) { schemaToFix.setAdditionalProperties(ignoreProperties.ignoreUnknown()); } else { // By default set addtionalProperties to false schemaToFix.setAdditionalProperties(false); } } } } return schema; } else { throw new IllegalStateException("This shouldn't be the last ModelConverter in the chain"); } } }