influxdata / influxdata/iot-api-python

The argument `authorization` in `create_authorization` needs to use a keyword

未關閉
#12 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
Python
星號
28
分支
10
PR 合併指標
30 天內沒有已合併 PR

描述

In `api/devices.py#162` the statement...

```
request = authorization_api.create_authorization(authorization)
```

should be

```
request = authorization_api.create_authorization(authorization=authorization)
```

This is related to.

* https://github.com/influxdata/influxdb-client-python/pull/682
* https://github.com/influxdata/influxdb-client-python/pull/680
* https://github.com/influxdata/docs-v2/pull/5701

Note that on clicking the _Auth_ link in the flask UI, the tutorial application is now returning...

```
ApiException
influxdb_client.rest.ApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json; charset=utf-8', 'X-Influxdb-Build': 'OSS', 'X-Influxdb-Version': 'v2.7.11', 'X-Platform-Error-Code': 'invalid', 'Date': 'Wed, 04 Dec 2024 13:04:14 GMT', 'Content-Length': '163'})
HTTP response body: {
"code": "invalid",
"message": "invalid json structure: json: cannot unmarshal object into Go struct field postAuthorizationRequest.orgID of type platform.ID"
}
```

The example here is causing confusion for some users.

I tried to push a branch with this change to create a PR, however I do not have write permissions to this repository.

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 api/devices.py#162 開始,檢查 Flask 教學流程中的 create_authorization 呼叫。更新參數用法,使其符合 issue 要求的關鍵字形式,然後測試 Auth 連結並確認它不再回傳所回報的 400 ApiException。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
api, backend
Issue 類型
缺陷
難度
1/5
預估耗時
1 小時以內
活躍度
停滯
描述清晰度
描述清楚
新手友好度
55/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。