Skip to content

Commit

Permalink
chore: release v4.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
CarstenWickner committed Apr 2, 2020
1 parent 6a3743a commit e44d982
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 38 deletions.
10 changes: 5 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [4.9.0] - 2020-04-02
### `jsonschema-generator`
#### Added
- Convenience constructor on `SchemaGeneratorConfigBuilder` without explicit `ObjectMapper` instance being expected
- Convenience constructors on `SchemaGeneratorConfigBuilder` without explicit `ObjectMapper` instance being expected
- Convenience methods on `FieldScope`/`MethodScope` for accessing (first level) container item annotations: `getContainerItemAnnotation()` and `getContainerItemAnnotationConsideringFieldAndGetter()`

#### Changed
Expand All @@ -18,7 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### `jsonschema-module-javax-validation`
#### Changed
- Consider (first level) container item annotations (e.g. List<@Size(min = 3) String>`)
- Consider (first level) container item annotations (e.g. `List<@Size(min = 3) String>`)

## [4.8.1] - 2020-03-31
### All
Expand Down Expand Up @@ -313,8 +313,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Indicate a number's "exclusiveMaximum" according to `@DecimalMax` or `@Negative`


[Unreleased]: https://github.com/victools/jsonschema-generator/compare/v4.8.1...HEAD
[4.8.1]: https://github.com/victools/jsonschema-generator/compare/v4.8.0...v4.8.2
[4.9.0]: https://github.com/victools/jsonschema-generator/compare/v4.8.1...v4.9.0
[4.8.1]: https://github.com/victools/jsonschema-generator/compare/v4.8.0...v4.8.1
[4.8.0]: https://github.com/victools/jsonschema-generator/compare/v4.7.0...v4.8.0
[4.7.0]: https://github.com/victools/jsonschema-generator/compare/v4.6.0...v4.7.0
[4.6.0]: https://github.com/victools/jsonschema-generator/compare/v4.5.0...v4.6.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Another example for such a module is:
<dependency>
<groupId>com.github.victools</groupId>
<artifactId>jsonschema-generator</artifactId>
<version>4.8.1</version>
<version>4.9.0</version>
</dependency>
```

Expand Down
18 changes: 8 additions & 10 deletions jsonschema-generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,22 @@ Topics covered in this document are:
<dependency>
<groupId>com.github.victools</groupId>
<artifactId>jsonschema-generator</artifactId>
<version>4.8.1</version>
<version>4.9.0</version>
</dependency>
```

### Code
#### Complete/Minimal Example
```java
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.victools.jsonschema.generator.OptionPreset;
import com.github.victools.jsonschema.generator.SchemaGenerator;
import com.github.victools.jsonschema.generator.SchemaGeneratorConfig;
import com.github.victools.jsonschema.generator.SchemaGeneratorConfigBuilder;
import com.github.victools.jsonschema.generator.SchemaVersion;
```
```java
ObjectMapper objectMapper = new ObjectMapper();
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(objectMapper, SchemaVersion.DRAFT_2019_09, OptionPreset.PLAIN_JSON);
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(SchemaVersion.DRAFT_2019_09, OptionPreset.PLAIN_JSON);
SchemaGeneratorConfig config = configBuilder.build();
SchemaGenerator generator = new SchemaGenerator(config);
JsonNode jsonSchema = generator.generateSchema(YourClass.class);
Expand All @@ -62,7 +60,7 @@ import com.github.victools.jsonschema.generator.SchemaGeneratorConfigBuilder;
import com.github.victools.jsonschema.generator.SchemaVersion;
```
```java
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(objectMapper, SchemaVersion.DRAFT_2019_09, OptionPreset.PLAIN_JSON);
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(SchemaVersion.DRAFT_2019_09, OptionPreset.PLAIN_JSON);
```

#### Toggling Standard Options (individually)
Expand All @@ -73,7 +71,7 @@ import com.github.victools.jsonschema.generator.SchemaGeneratorConfigBuilder;
import com.github.victools.jsonschema.generator.SchemaVersion;
```
```java
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(objectMapper, SchemaVersion.DRAFT_2019_09)
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(SchemaVersion.DRAFT_2019_09)
.with(Option.FLATTENED_ENUMS)
.without(Option.NULLABLE_FIELDS_BY_DEFAULT, Option.NULLABLE_METHOD_RETURN_VALUES_BY_DEFAULT);
```
Expand All @@ -86,7 +84,7 @@ import com.github.victools.jsonschema.generator.SchemaGeneratorConfigBuilder;
import com.github.victools.jsonschema.generator.SchemaVersion;
```
```java
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(objectMapper, SchemaVersion.DRAFT_2019_09, new OptionPreset())
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(SchemaVersion.DRAFT_2019_09, new OptionPreset())
.with(Option.ADDITIONAL_FIXED_TYPES, Option.PUBLIC_NONSTATIC_FIELDS);
```

Expand All @@ -98,7 +96,7 @@ import com.github.victools.jsonschema.generator.SchemaVersion;
```
```java
Module separateModule = new YourSeparateModule();
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(objectMapper, SchemaVersion.DRAFT_2019_09)
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(SchemaVersion.DRAFT_2019_09)
.with(separateModule);
```

Expand All @@ -112,7 +110,7 @@ import com.github.victools.jsonschema.generator.SchemaVersion;
import com.github.victools.jsonschema.generator.TypeScope;
```
```java
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(objectMapper, SchemaVersion.DRAFT_2019_09);
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(SchemaVersion.DRAFT_2019_09);
configBuilder.forTypesInGeneral()
// populate the "title" of all schemas with a description of the java type
.withTitleResolver(TypeScope::getSimpleTypeDescription);
Expand All @@ -134,7 +132,7 @@ import com.github.victools.jsonschema.generator.SchemaVersion;
import java.util.Map;
```
```java
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(objectMapper, SchemaVersion.DRAFT_2019_09)
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(SchemaVersion.DRAFT_2019_09)
.with(Option.FORBIDDEN_ADDITIONAL_PROPERTIES_BY_DEFAULT);
configBuilder.forTypesInGeneral()
.withAdditionalPropertiesResolver((scope) -> {
Expand Down
2 changes: 1 addition & 1 deletion jsonschema-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.github.victools</groupId>
<artifactId>jsonschema-generator-parent</artifactId>
<version>4.9.0-SNAPSHOT</version>
<version>4.9.0</version>
</parent>
<artifactId>jsonschema-generator</artifactId>

Expand Down
10 changes: 5 additions & 5 deletions jsonschema-module-jackson/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Schema attributes derived from validation annotations on getter methods are also
<dependency>
<groupId>com.github.victools</groupId>
<artifactId>jsonschema-module-jackson</artifactId>
<version>4.8.1</version>
<version>[4.9.0,5.0.0)</version>
</dependency>
```

Expand All @@ -33,28 +33,28 @@ It is recommended to use identical versions for both dependencies to ensure comp
#### Passing into SchemaGeneratorConfigBuilder.with(Module)
```java
import com.github.victools.jsonschema.generator.SchemaGeneratorConfigBuilder;
import com.github.victools.jsonschema.generator.SchemaVersion;
import com.github.victools.jsonschema.module.jackson.JacksonModule;
```
```java
JacksonModule module = new JacksonModule();
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(objectMapper)
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(SchemaVersion.DRAFT_2019_09)
.with(module);
```

#### Complete Example
```java
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.victools.jsonschema.generator.OptionPreset;
import com.github.victools.jsonschema.generator.SchemaGenerator;
import com.github.victools.jsonschema.generator.SchemaGeneratorConfig;
import com.github.victools.jsonschema.generator.SchemaGeneratorConfigBuilder;
import com.github.victools.jsonschema.generator.SchemaVersion;
import com.github.victools.jsonschema.module.jackson.JacksonModule;
```
```java
ObjectMapper objectMapper = new ObjectMapper();
JacksonModule module = new JacksonModule();
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(objectMapper, OptionPreset.PLAIN_JSON)
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(SchemaVersion.DRAFT_2019_09, OptionPreset.PLAIN_JSON)
.with(module);
SchemaGeneratorConfig config = configBuilder.build();
SchemaGenerator generator = new SchemaGenerator(config);
Expand Down
2 changes: 1 addition & 1 deletion jsonschema-module-jackson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.github.victools</groupId>
<artifactId>jsonschema-generator-parent</artifactId>
<version>4.9.0-SNAPSHOT</version>
<version>4.9.0</version>
</parent>
<artifactId>jsonschema-module-jackson</artifactId>

Expand Down
12 changes: 6 additions & 6 deletions jsonschema-module-javax-validation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Module for the [jsonschema-generator](../jsonschema-generator) – deriving JSON
7. Populate "minimum"/"exclusiveMinimum" for numbers. Based on `@Min`/`@DecimalMin`/`@Positive`/`@PositiveOrZero`
8. Populate "maximum"/"exclusiveMaximum" for numbers. Based on `@Max`/`@DecimalMax`/`@Negative`/`@NegativeOrZero`

Schema attributes derived from validation annotations on fields are also applied to their respective getter methods.
Schema attributes derived from validation annotations on fields are also applied to their respective getter methods.
Schema attributes derived from validation annotations on getter methods are also applied to their associated fields.

## Usage
Expand All @@ -22,7 +22,7 @@ Schema attributes derived from validation annotations on getter methods are also
<dependency>
<groupId>com.github.victools</groupId>
<artifactId>jsonschema-module-javax-validation</artifactId>
<version>4.8.1</version>
<version>[4.9.0,5.0.0)</version>
</dependency>
```

Expand All @@ -33,29 +33,29 @@ It is recommended to use identical versions for both dependencies to ensure comp
#### Passing into SchemaGeneratorConfigBuilder.with(Module)
```java
import com.github.victools.jsonschema.generator.SchemaGeneratorConfigBuilder;
import com.github.victools.jsonschema.generator.SchemaVersion;
import com.github.victools.jsonschema.module.javax.validation.JavaxValidationModule;
```
```java
JavaxValidationModule module = new JavaxValidationModule();
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(objectMapper)
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(SchemaVersion.DRAFT_2019_09)
.with(module);
```

#### Complete Example
```java
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.victools.jsonschema.generator.OptionPreset;
import com.github.victools.jsonschema.generator.SchemaGenerator;
import com.github.victools.jsonschema.generator.SchemaGeneratorConfig;
import com.github.victools.jsonschema.generator.SchemaGeneratorConfigBuilder;
import com.github.victools.jsonschema.generator.SchemaVersion;
import com.github.victools.jsonschema.module.javax.validation.JavaxValidationModule;
import com.github.victools.jsonschema.module.javax.validation.JavaxValidationOption;
```
```java
ObjectMapper objectMapper = new ObjectMapper();
JavaxValidationModule module = new JavaxValidationModule(JavaxValidationOption.INCLUDE_PATTERN_EXPRESSIONS);
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(objectMapper, OptionPreset.PLAIN_JSON)
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(SchemaVersion.DRAFT_2019_09, OptionPreset.PLAIN_JSON)
.with(module);
SchemaGeneratorConfig config = configBuilder.build();
SchemaGenerator generator = new SchemaGenerator(config);
Expand Down
2 changes: 1 addition & 1 deletion jsonschema-module-javax-validation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.github.victools</groupId>
<artifactId>jsonschema-generator-parent</artifactId>
<version>4.9.0-SNAPSHOT</version>
<version>4.9.0</version>
</parent>
<artifactId>jsonschema-module-javax-validation</artifactId>

Expand Down
11 changes: 6 additions & 5 deletions jsonschema-module-swagger-1.5/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Module for the [jsonschema-generator](../jsonschema-generator) – deriving JSON
9. Indicate a number's (field/method) "exclusiveMaximum" according to `@ApiModelProperty(allowableValues = "range...)")`
10. Indicate a field/method's "const"/"enum" as per `@ApiModelProperty(allowableValues = ...)` (if it is not a numeric range declaration)

Schema attributes derived from `@ApiModelProperty` on fields are also applied to their respective getter methods.
Schema attributes derived from `@ApiModelProperty` on fields are also applied to their respective getter methods.
Schema attributes derived from `@ApiModelProperty` on getter methods are also applied to their associated fields.

## Usage
Expand All @@ -24,7 +24,7 @@ Schema attributes derived from `@ApiModelProperty` on getter methods are also ap
<dependency>
<groupId>com.github.victools</groupId>
<artifactId>jsonschema-module-swagger-1.5</artifactId>
<version>4.8.1</version>
<version>[4.9.0,5.0.0)</version>
</dependency>
```

Expand All @@ -35,11 +35,12 @@ It is recommended to use identical versions for both dependencies to ensure comp
#### Passing into SchemaGeneratorConfigBuilder.with(Module)
```java
import com.github.victools.jsonschema.generator.SchemaGeneratorConfigBuilder;
import com.github.victools.jsonschema.generator.SchemaVersion;
import com.github.victools.jsonschema.module.swagger15.SwaggerModule;
```
```java
SwaggerModule module = new SwaggerModule();
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(objectMapper)
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(SchemaVersion.DRAFT_2019_09)
.with(module);
```

Expand All @@ -64,17 +65,17 @@ SwaggerModule module = new SwaggerModule(SwaggerOption.NO_APIMODEL_DESCRIPTION,
#### Complete Example
```java
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.victools.jsonschema.generator.OptionPreset;
import com.github.victools.jsonschema.generator.SchemaGenerator;
import com.github.victools.jsonschema.generator.SchemaGeneratorConfig;
import com.github.victools.jsonschema.generator.SchemaGeneratorConfigBuilder;
import com.github.victools.jsonschema.generator.SchemaVersion;
import com.github.victools.jsonschema.module.swagger15.SwaggerModule;
```
```java
ObjectMapper objectMapper = new ObjectMapper();
SwaggerModule module = new SwaggerModule();
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(objectMapper, OptionPreset.PLAIN_JSON)
SchemaGeneratorConfigBuilder configBuilder = new SchemaGeneratorConfigBuilder(SchemaVersion.DRAFT_2019_09, OptionPreset.PLAIN_JSON)
.with(module);
SchemaGeneratorConfig config = configBuilder.build();
SchemaGenerator generator = new SchemaGenerator(config);
Expand Down
2 changes: 1 addition & 1 deletion jsonschema-module-swagger-1.5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.github.victools</groupId>
<artifactId>jsonschema-generator-parent</artifactId>
<version>4.9.0-SNAPSHOT</version>
<version>4.9.0</version>
</parent>
<artifactId>jsonschema-module-swagger-1.5</artifactId>

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>com.github.victools</groupId>
<artifactId>jsonschema-generator-parent</artifactId>
<version>4.9.0-SNAPSHOT</version>
<version>4.9.0</version>
<packaging>pom</packaging>

<licenses>
Expand All @@ -26,7 +26,7 @@
<connection>scm:git:https://github.com/victools/jsonschema-generator.git</connection>
<developerConnection>scm:git:https://github.com/victools/jsonschema-generator.git</developerConnection>
<url>https://github.com/victools/jsonschema-generator</url>
<tag>HEAD</tag>
<tag>v4.9.0</tag>
</scm>

<organization>
Expand Down

0 comments on commit e44d982

Please sign in to comment.