algolia / algolia/algoliasearch-client-java

Discussion regarding `HttpTransport` exposed methods

オープン
#543 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
Discussion
主要言語
Java
スター
52
フォーク
33
PR マージ指標
30日以内にマージされた PR はありません

説明

> I think introducing helpers in "HttpTransport" would make the code in callers more straightforward. Let's introduce "HttpTransport.doGet(Async)", "HttpTransport.doPost(Async)", "HttpTransport.doPut(Async)", "HttpTransport.doDelete(Async)" - performing corresponding HTTP operations and setting the call type ~appropriately (eg READ for GET, WRITE otherwise - with the possibility for "doPost" to override it to "READ", or have a doPostForRead or something like that). This would also permit to remove the necessity of giving null data on GET, (doGet wouldn't take a "data" argument). As a second step, it could make sense to make requestAsync private.

Not really sure about this one! We have lots of combination with the endpoints such as. POST/READ/data:null, POST/WRITE/data or GET/READ/data:null. I fear that introducing an helper would reduce the "flexibility" of the transporter. I would prefer to keep it like this. WDYT @Anthony Seure?
Moreover, an overload is available for null data (I forgot to use it in getLogs() :D). So you can perform an executeRequestAsync without passing "null" explicitly as data : Example: POST without data.

cc @Ant-hem @BenoitPerrot

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

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず HttpTransport とその executeRequestAsync のオーバーロードを読み、次に getLogs() などの呼び出し元と、議論で説明されているエンドポイントの組み合わせを確認します。操作固有のヘルパーが既存の POST/READ、POST/WRITE、GET/READ の柔軟性を維持しているか判断してください。API の形と requestAsync の可視性に対する変更が合意され、一貫して適用された時点でのみ作業は完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
api
issue の種類
リファクタリング
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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