Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ethlo committed Aug 14, 2018
1 parent 19e248a commit 3abd1a0
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,32 @@ try (final Reader r = ...)
</complexType>
</schema>
```

## Support for non-standard types and formats

### Ignore unknown JSON formats
```java
final Config cfg = new Config.Builder()
.ignoreUnknownFormats(true)
...
.build();
```

### Register custom JSON formats
```java
final Config cfg = new Config.Builder()
.customTypeMapping(JsonSimpleType.INTEGER, "int64", XsdSimpleType.LONG)
.customTypeMapping(JsonSimpleType.INTEGER, "int32", XsdSimpleType.INT)
.customTypeMapping(JsonSimpleType.STRING, "ext-ref", XsdSimpleType.STRING)
...
.build();
```

### Register non-JSON types
```java
final Config cfg = new Config.Builder()
.nonJsonTypeMapping("date-time", XsdSimpleType.DATE_TIME)
.nonJsonTypeMapping("int", XsdSimpleType.INT)
...
.build();
```

0 comments on commit 3abd1a0

Please sign in to comment.