From f9c5c48a49b45f144f7bd93fef17f64c7aae2345 Mon Sep 17 00:00:00 2001 From: Carsten Wickner <11309681+CarstenWickner@users.noreply.github.com> Date: Sun, 21 Mar 2021 23:00:19 +0100 Subject: [PATCH] feat: support URI as simple type (#172) --- CHANGELOG.md | 1 + .../jsonschema/generator/impl/module/SimpleTypeModule.java | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index efa26023..341285f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### `jsonschema-generator` #### Changed - Increase of Jackson dependency version to 2.12.1 +- Include `java.net.URI` in handling of `Option.ADDITIONAL_FIXED_TYPES`. ### `jsonschema-module-jackson` #### Added diff --git a/jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/impl/module/SimpleTypeModule.java b/jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/impl/module/SimpleTypeModule.java index 37a60f03..6cc56a5e 100644 --- a/jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/impl/module/SimpleTypeModule.java +++ b/jsonschema-generator/src/main/java/com/github/victools/jsonschema/generator/impl/module/SimpleTypeModule.java @@ -87,6 +87,7 @@ public static SimpleTypeModule forPrimitiveAndAdditionalTypes() { java.util.Date.class, java.util.Calendar.class) .forEach(javaType -> module.withStringType(javaType, "date-time")); module.withStringType(java.util.UUID.class, "uuid"); + module.withStringType(java.net.URI.class, "uri"); module.withStringType(java.time.ZoneId.class); module.withIntegerType(java.math.BigInteger.class);