Multiple Issues with modify action for SAP SF OData API
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 268
- フォーク
- 100
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
I am using this library for developing a Python application that uses SAP SuccessFactors OData API. I spent last few days to resolve following issues with performing modify/update action but without any success. I finally came here to seek your help and suggestion. Please note that my application is already using this library for several OData query operations but I would prefer to use it also for update, create and delete operations too.
-
Single update request using "PUT" method is making the desired update into HttpError because the status code returned is 200 instead of 204. This is because the update_entity() function in the class EntitySetProxy expects it to be 204 always.
-
SAP SuccessFactors expects a custom method called "UPSERT" but the EntityModifyRequest class identifies it as invalid method.
-
Batch update request even with only one update changeset is failing with the "BadRequestException" (400) error : "Missing boundary delimiter at line '4'.". Code wise all looks good and as suggested in the usage guide. Also, the header as well as the body (prints as below in [] parentheses) of the batch request looks fine too. Could it be because of 2 line breaks on line 4 of the body?
Batch Req. Header: [{'Content-Type': 'multipart/mixed;boundary=batch_1850_4989_2562'}]
Batch Req. Body: [
--batch_1850_4989_2562
Content-Type: multipart/mixed;boundary=changeset_2364_6806_2818
--changeset_2364_6806_2818
Content-Type: application/http
Content-Transfer-Encoding:binary
PUT PickListValueV2(PickListV2_effectiveStartDate=datetime'2020-10-23T00:00:00',PickListV2_id='employeeGroup',externalCode='EX') HTTP/1.1
Accept: application/json
Content-Type: application/json
{"label_en_DEBUG": "External Employee", "status": "A"}
--changeset_2364_6806_2818--
--batch_1850_4989_2562--]
Sample Code:

コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
EntitySetProxy.update_entity() と EntityModifyRequest から始め、次に issue と使用ガイドにある PUT、UPSERT、バッチ更新の例を再現します。生成されたバッチ本文とレスポンス処理を確認します。200 件の更新が受け付けられ、UPSERT が認識され、単一の change set を含むバッチリクエストが boundary エラーなしで受け付けられれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- api
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 30/100