From 29497a557bdc9b4eb978678631e8afe870bbb841 Mon Sep 17 00:00:00 2001 From: Oscar Westra van Holthe - Kind Date: Fri, 23 Feb 2024 13:33:29 +0100 Subject: [PATCH] Update documentation --- README.md | 15 +++++++++++++-- doc/index.md | 12 ++++++------ pom.xml | 2 +- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 0704a08..d82653d 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,8 @@ section below. For the others, there is [more elaborate documentation](doc/index Quickstart ---------- -Want to jump right in? Here's a simple example to readan Avro schema, JSON schema, and JSON file, -and parse the latter using the first two: +Want to jump right in? Here's a simple example to read a JSON schema, manipulate in into an Avro +schema, and then parse a JSON file into the (different) Avro records: ```java import opwvhk.avro.SchemaManipulator; @@ -62,6 +62,17 @@ class Example { } ``` +Upgrade notes +------------- + +### From 1.3 to 2.0 + +1. XML validation has been changed. Now, parsing will either always or never validate, depending on + how the parser was created. See the constructor parameters for details. +2. Constructing a JSON parser can no longer throw a (library specific) `GenerationException`; this + has become a runtime exception instead. + + Contributing ✨ --------------- diff --git a/doc/index.md b/doc/index.md index 4f41671..df2865b 100644 --- a/doc/index.md +++ b/doc/index.md @@ -21,12 +21,12 @@ records. The following formats can be converted to Avro: -| Format | Parser constructor | Parser class | -|--------------------|-----------------------------------------------------|-------------------------------------| -| JSON (with schema) | `JsonAsAvroParser(URI, Schema, GenericData)` | `opwvhk.avro.json.JsonAsAvroParser` | -| JSON (unvalidated) | `JsonAsAvroParser(Schema, GenericData)` | `opwvhk.avro.json.JsonAsAvroParser` | -| XML (with XSD) | `XmlAsAvroParser(URL, String, Schema, GenericData)` | `opwvhk.avro.xml.XmlAsAvroParser` | -| XML (unvalidated) | `XmlAsAvroParser(Schema, GenericData)` | `opwvhk.avro.xml.XmlAsAvroParser` | +| Format | Parser constructor | +|--------------------|----------------------------------------------------------------------------------------------| +| JSON (with schema) | `opwvhk.avro.json.JsonAsAvroParser#JsonAsAvroParser(URI, boolean, Schema, GenericData)` | +| JSON (unvalidated) | `opwvhk.avro.json.JsonAsAvroParser#JsonAsAvroParser(Schema, GenericData)` | +| XML (with XSD) | `opwvhk.avro.xml.XmlAsAvroParser#XmlAsAvroParser(URL, String, boolean, Schema, GenericData)` | +| XML (unvalidated) | `opwvhk.avro.xml.XmlAsAvroParser#XmlAsAvroParser(Schema, GenericData)` | Parsers all use both a write schema and a read schema, just like Avro does. The write schema is used to validate the input, and the read schema is used to describe the result. diff --git a/pom.xml b/pom.xml index 987da34..bcf4d14 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ avro-conversions jar - 1.4-SNAPSHOT + 2.0-SNAPSHOT Avro Conversions Schema based conversions for Avro for JSON, XML