nextcloud / nextcloud/Android-SingleSignOn

Convenience features for `NextcloudRequest.Builder`

オープン
#413 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Java
スター
74
フォーク
36
平均マージ
1日 19時間
マージ済み PR(30日)
17

説明

Issue

The following setup for a NextcloudRequest is quite verbose:

final var parameters = Collections.singleton(new QueryParam("foo", "bar"));
final var nextcloudRequest = new NextcloudRequest.Builder()
    .setMethod("GET")
    .setParameter(parameters)
    .setUrl("/endpoint")
    .build();

Especially for beginners, we should try to minimize the necessary boilerplate code to perform an actual request.

Proposal

Automatically parse QueryParams from the given URL

We could parse the QueryParams from the given URL and add them to our Collection (just as if .setParameter() would have been called). A working sample implementation (in Kotlin) is already in the nextcloud-commons library available.

final var nextcloudRequest = new NextcloudRequest.Builder()
    .setMethod("GET")
    .setParameter(parameters)
    .setUrl("/endpoint?foo=bar")
    .build();

Default method property to GET

It is the most often used HTTP verb and a natural choice to be preset (of course with keeping the possibility to override it):

final var parameters = Collections.singleton(new QueryParam("foo", "bar"));
final var nextcloudRequest = new NextcloudRequest.Builder()
    .setParameter(parameters)
    .setUrl("/endpoint")
    .build();

Looking forward to some opinions 🙂
PS.: This issue has been split out of #266

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

NextcloudRequest.Builder の実装から始め、build() 前に setUrl、setParameter、HTTP メソッドがどのように保存されるかを確認してください。要求されている URL の解析をリンク先の Kotlin サンプルと比較し、そのうえで URL パラメータが含まれること、GET がデフォルトであること、明示的に選択したメソッドも引き続き機能することを検証してください。

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

評価

技術スタック
android, java
領域
mobile
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

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

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