Skip to content

Commit

Permalink
refs #4212 - update jackson API usage to support Jackson < 2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
frantuma committed Jul 19, 2022
1 parent 7c778d2 commit 45e1541
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.fasterxml.jackson.databind.introspect.AnnotatedClass;
import com.fasterxml.jackson.databind.introspect.AnnotatedMember;
import com.fasterxml.jackson.databind.introspect.AnnotatedMethod;
import com.fasterxml.jackson.databind.introspect.AnnotationMap;
import com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition;
import com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder;
import com.fasterxml.jackson.databind.jsontype.NamedType;
Expand Down Expand Up @@ -577,11 +576,8 @@ public Schema resolve(AnnotatedType annotatedType, ModelConverterContext context
if (member != null && !ignore(member, xmlAccessorTypeAnnotation, propName, propertiesToIgnore, propDef)) {

List<Annotation> annotationList = new ArrayList<>();
AnnotationMap annotationMap = member.getAllAnnotations();
if (annotationMap != null) {
for (Annotation a : annotationMap.annotations()) {
annotationList.add(a);
}
for (Annotation a : member.annotations()) {
annotationList.add(a);
}

annotations = annotationList.toArray(new Annotation[annotationList.size()]);
Expand Down Expand Up @@ -1120,11 +1116,8 @@ protected Schema processAsId(String propertyName, AnnotatedType type,
return PrimitiveType.createProperty(propType);
} else {
List<Annotation> list = new ArrayList<>();
AnnotationMap annotationMap = propMember.getAllAnnotations();
if (annotationMap != null) {
for (Annotation a : annotationMap.annotations()) {
list.add(a);
}
for (Annotation a : propMember.annotations()) {
list.add(a);
}
Annotation[] annotations = list.toArray(new Annotation[list.size()]);
AnnotatedType aType = new AnnotatedType()
Expand Down
8 changes: 2 additions & 6 deletions modules/swagger-project-jakarta/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -575,12 +575,8 @@
<servlet-api-version>5.0.0</servlet-api-version>
<jersey2-version>3.0.1</jersey2-version>
<junit-version>4.13.1</junit-version>
<jackson-version>2.13.2</jackson-version>
<!--
2.13.2 is still affected by CVE-2020-36518.
This version pin for jackson-databind can be removed when bumping jackson to 2.14
-->
<jackson-databind-version>2.13.2.2</jackson-databind-version>
<jackson-version>2.13.3</jackson-version>
<jackson-databind-version>2.13.3</jackson-databind-version>
<logback-version>1.2.9</logback-version>
<classgraph-version>4.8.138</classgraph-version>
<guava-version>31.0.1-jre</guava-version>
Expand Down
8 changes: 2 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -655,12 +655,8 @@
<servlet-api-version>4.0.3</servlet-api-version>
<jersey2-version>2.26</jersey2-version>
<junit-version>4.13.1</junit-version>
<jackson-version>2.13.2</jackson-version>
<!--
jackson-databind 2.13.2 is still affected by CVE-2020-36518.
This version pin for jackson-databind can be removed when bumping jackson to 2.14
-->
<jackson-databind-version>2.13.2.2</jackson-databind-version>
<jackson-version>2.13.3</jackson-version>
<jackson-databind-version>2.13.3</jackson-databind-version>
<logback-version>1.2.9</logback-version>
<classgraph-version>4.8.138</classgraph-version>
<guava-version>31.0.1-jre</guava-version>
Expand Down

0 comments on commit 45e1541

Please sign in to comment.