googleapis / googleapis/google-cloud-java

[java-firestore] Register custom bean deserializers on a Firestore used by toObject(Class)

オープン
#13,136 コメント 1 件 リアクション 4 件 担当者 0 名 GitHub で見る
api: firestore type: feature request
主要言語
Java
スター
2.1k
フォーク
1.2k
平均マージ
1日 23時間
マージ済み PR(30日)
154

説明

Using `com.google.cloud:google-cloud-firestore:2.1.0`.

I briefly looked at the source code in`DocumentSnapshot` among others and I could not see a way for us to register or use a custom deserializer.

We could easily have done this ourself if `DocumentSnapshot.getData` didn't return incomplete data(key value pair for id field is not included. The key name for the id field is not even present in the response although we could use reflection to find it).

I am hoping to be able to register a Jackson converter for reasons like I don't want to create a default constructor for data classes in Kotlin, json sub types and more.

My wish:

```
interface FirestoreDocDeserializer {
T deserialize(Map data);
}
```

Parameter `data` would basically be the data returned by `DocumentSnapshot.getData` but with key value pair of the id field included.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。