FasterXML / FasterXML/jackson-dataformats-binary

Cannot find method to generate AVRO schema will nullable Map values

Open
#154 3 comments 0 reactions 0 assignees View on GitHub
avro
Dominant language
Java
Stars
347
Forks
156
Avg merge
3d 3h
Merged PRs (30d)
22

Description

This class when Avro'd

```
public final class Foo {
private Map strings;

public Map getStrings() {
return strings;
}

public void setStrings( Map strings ) {
this.strings = strings;
}
```
Results in this schema:

```
{
"type" : "record",
"name" : "Foo",
"namespace" : "my.package",
"doc" : "Schema for my.package",
"fields" : [ {
"name" : "strings",
"type" : [ "null", {
"type" : "map",
"values" : "string"
} ]
}
```

Where as I want this schema:
```

{
"type" : "record",
"name" : "Foo",
"namespace" : "my.package",
"doc" : "Schema for my.package",
"fields" : [ {
"name" : "strings",
"type" : [ "null", {
"type" : "map",
"values" : [ "null", "string" ]
} ]
}
```

I can't see a way to do this currently.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.