Scenario bundle PATCH accepts ?expand=labels but ignores it

オープン 初心者向け
#2,580 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
django, python
領域
api, backend

調査の方向性

oekg/api_views.py の OekgAPIView.initial と、patch の末尾にある return bundle_response(...) から始めます。labels を解決する bundle GET とその他の書き込みエンドポイントを比較し、PATCH が ?expand=labels を処理するか、一貫して拒否することを示す回帰テストを追加します。選択した動作とレスポンスが一致すれば完了です。

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

説明

API bug

PATCH /api/v0/scenario-bundles/<uid>/ accepts ?expand=labels (the parameter is validated for every view in OekgAPIView.initial) but does not act on it: the response is built without the expansion set (oekg/api_views.py, the return bundle_response(...) at the end of patch, which passes no expand=). Every other write below a bundle (scenario and study report writes, dataset link writes, replace/) resolves labels when asked, and the bundle GET does too.

So a client asking for labels on a bundle patch silently gets none. Either honour it (pass expand=self.expand, one line, plus a test) or refuse it with the same 400 an unknown expansion gets, by not offering labels on that method.

Found while annotating the endpoints for the OpenAPI reference (#2480); the documentation deliberately does not claim the parameter works there.

主要言語
Python
スター
65
フォーク
28
平均マージ
4日 7時間
マージ済み PR(30日)
25

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

OpenEnergyPlatform/oeplatform のほかの issue

OpenEnergyPlatform/oeplatform の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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