microsoftgraph / microsoftgraph/msgraph-sdk-php
JSON Encode models
Nessuno ha ancora preso questa issue.
- Lingua principale
- PHP
- Stelle
- 669
- Fork
- 150
- Merge medio
- 15h 21m
- PR unite (30g)
- 3
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
La issue nomina i modelli del PHP SDK e il relativo BackingStore, ma non indica alcun file sorgente, punto di ingresso o test. Inizia individuando la serializzazione dei modelli e la gestione di JSON, quindi conferma l’output previsto dell’oggetto completo e aggiungi o aggiorna la copertura; la issue non definisce criteri di accettazione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- php
- Ambito
- api
- Tipo di issue
- Bug
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 15/100