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

Commit d65a23e

Browse files
Update README for v3.2.0
1 parent 3486740 commit d65a23e

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ Module for the `jsonschema-generator` – deriving JSON Schema attributes from `
66

77
## Features
88
1. Determine whether a member is not nullable, base assumption being that all fields and method return values are nullable if not annotated. Based on `@NotNull`/`@Null`/`@NotEmpty`/`@NotBlank`
9-
2. Populate "minItems" and "maxItems" for containers (i.e. arrays and collections). Based on `@Size`/`@NotEmpty`
10-
3. Populate "minLength" and "maxLength" for strings. Based on `@Size`/`@NotEmpty`/`@NotBlank`
11-
4. Populate "minimum"/"exclusiveMinimum" for numbers. Based on `@Min`/`@DecimalMin`/`@Positive`/`@PositiveOrZero`
12-
5. Populate "maximum"/"exclusiveMaximum" for numbers. Based on `@Max`/`@DecimalMax`/`@Negative`/`@NegativeOrZero`
9+
2. Populate list of "required" fields/methods for objects if `JavaxValidationOption.NOT_NULLABLE_FIELD_IS_REQUIRED` and/or `JavaxValidationOption.NOT_NULLABLE_METHOD_IS_REQUIRED` is/are being provided in constructor.
10+
3. Populate "minItems" and "maxItems" for containers (i.e. arrays and collections). Based on `@Size`/`@NotEmpty`
11+
4. Populate "minLength" and "maxLength" for strings. Based on `@Size`/`@NotEmpty`/`@NotBlank`
12+
5. Populate "format" for strings. Based on `@Email`, can be "email" or "idn-email" depending on whether `JavaxValidationOption.PREFER_IDN_EMAIL_FORMAT` is being provided in constructor.
13+
6. Populate "pattern" for strings. Based on `@Pattern`/`@Email`, when corresponding `JavaxValidationOption.INCLUDE_PATTERN_EXPRESSIONS` is being provided in constructor.
14+
7. Populate "minimum"/"exclusiveMinimum" for numbers. Based on `@Min`/`@DecimalMin`/`@Positive`/`@PositiveOrZero`
15+
8. Populate "maximum"/"exclusiveMaximum" for numbers. Based on `@Max`/`@DecimalMax`/`@Negative`/`@NegativeOrZero`
1316

1417
Schema attributes derived from validation annotations on fields are also applied to their respective getter methods.
1518
Schema attributes derived from validation annotations on getter methods are also applied to their associated fields.
@@ -20,7 +23,7 @@ Schema attributes derived from validation annotations on getter methods are also
2023
<dependency>
2124
<groupId>com.github.victools</groupId>
2225
<artifactId>jsonschema-module-javax-validation</artifactId>
23-
<version>3.0.0</version>
26+
<version>3.2.0</version>
2427
</dependency>
2528
```
2629

@@ -45,10 +48,11 @@ import com.github.victools.jsonschema.generator.SchemaGenerator;
4548
import com.github.victools.jsonschema.generator.SchemaGeneratorConfig;
4649
import com.github.victools.jsonschema.generator.SchemaGeneratorConfigBuilder;
4750
import com.github.victools.jsonschema.module.javax.validation.JavaxValidationModule;
51+
import com.github.victools.jsonschema.module.javax.validation.JavaxValidationOption;
4852
```
4953
```java
5054
ObjectMapper objectMapper = new ObjectMapper();
51-
JavaxValidationModule module = new JavaxValidationModule();
55+
JavaxValidationModule module = new JavaxValidationModule(JavaxValidationOption.INCLUDE_PATTERN_EXPRESSIONS);
5256
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(objectMapper, OptionPreset.PLAIN_JSON)
5357
.with(module);
5458
SchemaGeneratorConfig config = configBuilder.build();

0 commit comments

Comments
 (0)