Skip to content
This repository was archived by the owner on Mar 30, 2020. It is now read-only.

Commit 4eb7176

Browse files
chore: bump jsonschema-generator dependency to 4.7.0 (#5)
1 parent cb4bbc7 commit 4eb7176

File tree

3 files changed

+13
-20
lines changed

3 files changed

+13
-20
lines changed

pom.xml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<groupId>com.github.victools</groupId>
1010
<artifactId>jsonschema-module-javax-validation</artifactId>
11-
<version>4.4.0</version>
11+
<version>4.7.0-SNAPSHOT</version>
1212
<packaging>jar</packaging>
1313

1414
<licenses>
@@ -27,7 +27,7 @@
2727
<connection>scm:git:ssh://github.com/victools/jsonschema-module-javax-validation.git</connection>
2828
<developerConnection>scm:git:ssh://git@github.com/victools/jsonschema-module-javax-validation.git</developerConnection>
2929
<url>https://github.com/victools/jsonschema-module-javax-validation</url>
30-
<tag>v4.4.0</tag>
30+
<tag>HEAD</tag>
3131
</scm>
3232

3333
<organization>
@@ -58,7 +58,7 @@
5858
<maven.compiler.source>1.8</maven.compiler.source>
5959
<maven.compiler.target>1.8</maven.compiler.target>
6060

61-
<version.generator>4.4.0</version.generator>
61+
<version.generator>4.7.0</version.generator>
6262

6363
<version.javax.validation>2.0.1.Final</version.javax.validation>
6464

@@ -68,10 +68,6 @@
6868
<version.mockito>2.27.0</version.mockito>
6969
</properties>
7070

71-
<prerequisites>
72-
<maven>3.5</maven>
73-
</prerequisites>
74-
7571
<dependencies>
7672
<dependency>
7773
<groupId>com.github.victools</groupId>
@@ -114,6 +110,13 @@
114110

115111
<build>
116112
<plugins>
113+
<plugin>
114+
<artifactId>maven-compiler-plugin</artifactId>
115+
<version>2.3.2</version>
116+
<configuration>
117+
<showDeprecation>true</showDeprecation>
118+
</configuration>
119+
</plugin>
117120
<plugin>
118121
<artifactId>maven-checkstyle-plugin</artifactId>
119122
<version>3.0.0</version>

src/main/java/com/github/victools/jsonschema/module/javax/validation/JavaxValidationModule.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,7 @@ private void applyToConfigPart(SchemaGeneratorConfigPart<?> configPart) {
143143
*/
144144
protected <A extends Annotation> A getAnnotationFromFieldOrGetter(MemberScope<?, ?> member, Class<A> annotationClass,
145145
Function<A, Class<?>[]> validationGroupsLookup) {
146-
A annotation = member.getAnnotation(annotationClass);
147-
if (annotation == null) {
148-
MemberScope<?, ?> associatedGetterOrField;
149-
if (member instanceof FieldScope) {
150-
associatedGetterOrField = ((FieldScope) member).findGetter();
151-
} else if (member instanceof MethodScope) {
152-
associatedGetterOrField = ((MethodScope) member).findGetterField();
153-
} else {
154-
associatedGetterOrField = null;
155-
}
156-
annotation = associatedGetterOrField == null ? null : associatedGetterOrField.getAnnotation(annotationClass);
157-
}
146+
A annotation = member.getAnnotationConsideringFieldAndGetter(annotationClass);
158147
if (annotation != null) {
159148
Class<?>[] associatedGroups = validationGroupsLookup.apply(annotation);
160149
/*

src/test/java/com/github/victools/jsonschema/module/javax/validation/IntegrationTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.github.victools.jsonschema.generator.SchemaGenerator;
2222
import com.github.victools.jsonschema.generator.SchemaGeneratorConfig;
2323
import com.github.victools.jsonschema.generator.SchemaGeneratorConfigBuilder;
24+
import com.github.victools.jsonschema.generator.SchemaVersion;
2425
import java.io.IOException;
2526
import java.io.InputStream;
2627
import java.nio.charset.StandardCharsets;
@@ -58,7 +59,7 @@ public void testIntegration() throws Exception {
5859
JavaxValidationOption.NOT_NULLABLE_FIELD_IS_REQUIRED,
5960
JavaxValidationOption.NOT_NULLABLE_METHOD_IS_REQUIRED,
6061
JavaxValidationOption.INCLUDE_PATTERN_EXPRESSIONS);
61-
SchemaGeneratorConfig config = new SchemaGeneratorConfigBuilder(new ObjectMapper())
62+
SchemaGeneratorConfig config = new SchemaGeneratorConfigBuilder(new ObjectMapper(), SchemaVersion.DRAFT_2019_09)
6263
.with(module)
6364
.build();
6465
SchemaGenerator generator = new SchemaGenerator(config);

0 commit comments

Comments
 (0)