FasterXML / FasterXML/jackson-dataformats-binary

Support for Protobuf WellKnownTypes when generating schema with ProtobufMapper

Ouverte
#349 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
protobuf
Langage dominant
Java
Étoiles
347
Forks
156
Merge moyen
3 j 3 h
PR mergées (30 j)
22

Description

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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.