JSON Encode models

オープン
#1,452 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
15/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
php
領域
api

調査の方向性

この issue では PHP SDK のモデルとその BackingStore が挙げられていますが、ソースファイル、エントリポイント、テストは示されていません。まずモデルのシリアライズと JSON の処理箇所を特定し、次に完全なオブジェクトの期待される出力を確認して、カバレッジを追加または更新してください。この issue では受け入れ基準が定義されていません。

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

説明

v2: feedback

Hi,

I've been implementing the v2.2 version of the msgraph-sdk this week; however I'm facing an issue.
How can I encode the models returned from the client to JSON so it contains all values? It seems the actual values are in the BackingStore, but how can I make sure I get the actual data to be passed in a response?

For e.g. this works; but doesn't feel as the right solution:

json_encode($event->getBackingStore()->enumerate());

For reference, this is my code example below;

$requestConfig = new CalendarViewRequestBuilderGetRequestConfiguration(
    headers: [
        'Prefer' => 'outlook.timezone="W. Europe Standard Time"',
    ],
    queryParameters: CalendarViewRequestBuilderGetRequestConfiguration::createQueryParameters(
        endDateTime: $endDate,
        startDateTime: $startDate,
        top: 500
    )
);

$events = $this->graphClient
    ->users()
    ->byUserId($userId)
    ->calendar()
    ->calendarView()
    ->get($requestConfig)
    ->wait()
;

foreach ($events->getValue() as $event) {
        // I want to get the complete object as JSON values to be passed in a response
        json_encode($event->getBackingStore()->enumerate());
}

Thank you in advance

主要言語
PHP
スター
669
フォーク
150
平均マージ
15時間 21分
マージ済み PR(30日)
3

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

microsoftgraph/msgraph-sdk-php のほかの issue

microsoftgraph/msgraph-sdk-php の issue をすべて見る

似ている issue

PHP の issue をもっと見る

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

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