microsoft.graph.onPremisesPublishing wrong serialization
まだ誰も着手していません。
評価
調査の方向性
生成された Application モデルと OnPremisesPublishing モデル、および再現に使用される JsonSerializationWriter から始めます。提供されたシリアライゼーション例を実行し、その onPremisesPublishing の出力を additional_data の回避策と比較します。SDK がバックエンドに受け入れられる JSON を出力し、patch リクエストが InvalidJson_BadRequest を返さなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
Same bug as in the PHP SDK from 2025
https://github.com/microsoftgraph/msgraph-beta-sdk-php/issues/356
from msgraph_beta import GraphServiceClient as BetaClient
from msgraph_beta.generated.models.application import Application as Application
from msgraph_beta.generated.models.on_premises_publishing import OnPremisesPublishing
from msgraph_beta.generated.models.external_authentication_type import ExternalAuthenticationType
request_body = Application(
on_premises_publishing = OnPremisesPublishing(
external_authentication_type=ExternalAuthenticationType.Passthru,
internal_url="http://localhost:65001",
external_url="https://whatever",
is_http_only_cookie_enabled=False,
is_on_prem_publishing_enabled=True,
is_persistent_cookie_enabled=False,
is_secure_cookie_enabled=False,
is_state_session_enabled=False,
is_translate_host_header_enabled=False,
is_translate_links_in_body_enabled=False,
is_backend_certificate_validation_enabled=False
),
)
from kiota_serialization_json.json_serialization_writer import JsonSerializationWriter
writer = JsonSerializationWriter()
request_body.serialize(writer)
print(writer.get_serialized_content().decode('utf-8'))
Output:
{"@odata.type": "#microsoft.graph.application", "onPremisesPublishing": {"externalAuthenticationType": "passthru", "externalUrl": "https://whatever", "internalUrl": "http://localhost:65001", "isBackendCertificateValidationEnabled": false, "isHttpOnlyCookieEnabled": false, "isOnPremPublishingEnabled": true, "isPersistentCookieEnabled": false, "isSecureCookieEnabled": false, "isStateSessionEnabled": false, "isTranslateHostHeaderEnabled": false, "isTranslateLinksInBodyEnabled": false}}
await beta_client.applications.by_application_id(app.application.id).patch(request_body) then fails with
APIError
Code: 400
message: None
error: MainError(additional_data={}, code='InvalidJson_BadRequest', details=None, inner_error=InnerError(additional_data={}, client_request_id='xxxx', date=datetime.datetime(2026, 7, 10, 8, 49, 27), odata_type=None, request_id='xxxx'), message='Valid JSON content expected.', target=None)
Expected behavior
proper error message and properly serialized data sent to the backend
How to reproduce
see above
SDK Version
1.59.0
Latest version known to work for scenario above?
No response
Known Workarounds
request_body = BetaApplication(
additional_data = {
"microsoft.graph.onPremisesPublishing": {
"@odata.type": "#microsoft.graph.onPremisesPublishing",
"externalAuthenticationType": "passthru",
"internalUrl": "http://localhost:65001",
"externalUrl": EXTERNAL_URL,
"isHttpOnlyCookieEnabled": False,
"isOnPremPublishingEnabled": True,
"isPersistentCookieEnabled": False,
"isSecureCookieEnabled": False,
"isStateSessionEnabled": False,
"isTranslateHostHeaderEnabled": False,
"isTranslateLinksInBodyEnabled": False,
"isBackendCertificateValidationEnabled": False
}
}
)
Debug output
No response
Configuration
No response
Other information
No response
- 主要言語
- Python
- スター
- 630
- フォーク
- 96
- 平均マージ
- 15時間 20分
- マージ済み PR(30日)
- 3
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoftgraph/msgraph-sdk-python のほかの issue
-
status:waiting-for-triage type:bug
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
microsoftgraph/msgraph-sdk-python#1570 ·
-
status:waiting-for-triage type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
microsoftgraph/msgraph-sdk-python#1563 ·
-
Needs: Attention :wave: type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
microsoftgraph/msgraph-sdk-python#1287 · コメント 2 件 · リアクション 1 件 ·
-
status:waiting-for-triage
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
microsoftgraph/msgraph-sdk-python#1557 ·
-
status:waiting-for-triage type:bug
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
microsoftgraph/msgraph-sdk-python#1556 · コメント 1 件 · リアクション 1 件 ·
microsoftgraph/msgraph-sdk-python の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
OpenHands/extensions#626 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
CSCfi/sd-search-api#39 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
StevenBlack/hosts#3255 ·