[Feature]: Refactor `_determine_api_url` method in `Adyen/client.py`
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
Adyen/client.py で _determine_api_url を読み、これに依存する既存の API 呼び出しを追跡することから始めます。集中型のマッピングを選択する前に、提案されているサービスレベルのアプローチとメソッド名ベースのアプローチを比較します。文字列ベースのチェックが削除され、URL の判定を拡張しやすくなり、既存のすべての API 呼び出しが引き続き機能すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Feature summary
No response
Problem statement
The _determine_api_url method in Adyen/client.py is fragile and difficult to maintain. It relies on string manipulation and hardcoded values to determine the correct API endpoint URL. This makes it prone to errors and difficult to extend.
Problem:
- The current implementation uses a series of
if/elifstatements withinchecks on the endpoint string. This is not robust and can break if endpoint names change. - It has special logic for "pal-" and "checkout-" prefixes, including hardcoded URLs.
Proposed solution
The logic for determining the correct endpoint URL should be more robust and centralized. Here are two potential approaches:
- Service-level mapping: The service calling the client should be responsible for providing the correct and complete URL. The
_determine_api_urlmethod would then become a simple pass-through or perform minimal validation. - Method-name-based mapping: Instead of relying on URL substrings, the client could use the service and method names to look up the correct endpoint from a structured configuration or map. This would decouple the logic from the specific URL structure.
Alternatives considered
Another alternative is to rely on the "servers" field of OpenAPI specs, but currently those don't contain mappings for all environments
Additional context
Acceptance Criteria:
- Remove the string-based checks in
_determine_api_url. - Implement a more robust mechanism for URL determination.
- Ensure all existing API calls continue to work correctly.
- The new implementation should be easier to read, maintain, and extend for future services.
- 主要言語
- Python
- スター
- 68
- フォーク
- 51
- 平均マージ
- 2時間 3分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Adyen/adyen-python-api-library のほかの issue
-
[Bug] api_*_version override has no effect on PAL-based service URLs対応中かも @cobanfurkanx が 9 日前に担当しました。 オープンBug do not stale
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
Feature
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
Adyen/adyen-python-api-library#487 · コメント 1 件 · リアクション 1 件 ·
-
[Test] Add baseUrl environment tests to all service test files対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンdo not stale Test
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
-
chore: consolidate package metadata into pyproject.toml (PEP 621)対応中かも @erdemtuna が 191 日前に担当しました。 オープンdo not stale
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
-
[Bug]: Unknown properties return None対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンdo not stale
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
Adyen/adyen-python-api-library#397 · コメント 2 件 ·
Adyen/adyen-python-api-library の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
jbacalso24/mimry#291 ·
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 2/5 1時間未満 初心者へのやさしさ 82/100
eli-alvarado/us-watchlist-alerts#14 ·
メンテナーはふだん 1 日以内に返信
-
from-review-extraction python severity:nit
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
LearningCircuit/local-deep-research#7462 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
cathrynlavery/diagram-design#441 ·
メンテナーはふだん 2 日以内に返信
-
[Cleanup] Include the public header in work_split.cpp対応中かも @blozano-tt が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
tenstorrent/tt-metal#60850 ·
メンテナーはふだん 1 日以内に返信