FasterXML / FasterXML/jackson-dataformats-binary

Support for Protobuf WellKnownTypes when generating schema with ProtobufMapper

Aperta
#349 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
protobuf
Lingua principale
Java
Stelle
347
Fork
156
Merge medio
3g 3h
PR unite (30g)
22

Descrizione

Assuming we have a Java POJO such as:
```java
public record Test(String value, Instant ts) {
}
```

And then we use:
```scala
private val protobufMapper = ProtobufMapper.builder
.addModule(new JavaTimeModule)
.build()

val jacksonProtoSchema = protobufMapper.generateSchemaFor(classOf[Test])
```

The `ts` field will be automatically mapped as `double`. I'm looking at a way to have it converted to a Message type of `google.protobuf.Timestamp`. I've tried using a new module with custom ser/deserializers but the issue there is it drops `google.protobuf.` qualifiers for the type, using the simple name of the raw class instead.

I've looked at the code as well and cannot find anything that would support this so I'm not sure if I'm missing something or if this would be new functionality.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.