Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
opwvhk committed Feb 23, 2024
1 parent b065dd3 commit 29497a5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 ✨
---------------

Expand Down
12 changes: 6 additions & 6 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<artifactId>avro-conversions</artifactId>
<packaging>jar</packaging>
<version>1.4-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>

<name>Avro Conversions</name>
<description>Schema based conversions for Avro for JSON, XML</description>
Expand Down

0 comments on commit 29497a5

Please sign in to comment.