FasterXML / FasterXML/jackson-dataformats-binary

Cannot find method to generate AVRO schema will nullable Map values

Offen
#154 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
avro
Vorherrschende Sprache
Java
Sterne
347
Forks
156
Ø Merge
3 T. 3 Std.
Gemergte PRs (30 T.)
22

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.