Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem calling PATCH on an OnlineMeeting #1484

Closed
gkotsinos opened this issue Mar 13, 2024 · 5 comments · Fixed by microsoft/kiota-serialization-json-php#63 or microsoft/kiota-serialization-json-php#62
Assignees
Labels

Comments

@gkotsinos
Copy link

gkotsinos commented Mar 13, 2024

Hello,

as stated, I am trying to patch an Microsoft\Graph\Generated\Models\OnlineMeeting model. The error I am getting is that I am sending a property that isn't allowed to get PATCHed. After some debugging I figured out that although during the instantiation of my OnlineMeeting object I am only filling the attendees property, the body of the request ends up being this:

{"@odata.type":"#microsoft.graph.onlineMeeting","attendeeReport":null,"participants":{"attendees":[{"upn":"[email protected]"}]}}

From what I understand the attendeeReport property should not end up in the request body since I am not setting it, and I have confirmed that is the issue since sending the same request without the property works fine.

Also as defined in the relevant documentation this property is not even in the list of options that are updateable ( https://learn.microsoft.com/en-us/graph/api/onlinemeeting-update?view=graph-rest-1.0&tabs=http#request-body )

EDIT: I can successfully solve the issue with this simplistic approach confirming the issue:

Within Microsoft\Graph\Generated\Models\OnlineMeeting

change this line:

$writer->writeBinaryContent('attendeeReport', $this->getAttendeeReport());

to this line:
if (!empty($this->getAttendeeReport())) { $writer->writeBinaryContent('attendeeReport', $this->getAttendeeReport()); }

@SilasKenneth
Copy link
Member

SilasKenneth commented Mar 13, 2024

Hi @gkotsinos ,thank you for trying out the SDK, I am currently looking into the issue. In the meantime, could you please provide the version of the SDK you are using and the code you are trying to run(if possible).

@SilasKenneth SilasKenneth self-assigned this Mar 13, 2024
@gkotsinos
Copy link
Author

gkotsinos commented Mar 13, 2024

Hi @gkotsinos ,thank you for trying out the SDK, I am currently looking into the issue. In the meantime, could you please provide the version of the SDK you are using and the code you are trying to run(if possible).

Hi, thanks for the quick response! I can't share the exact code but you should be able to easilly reproduce it. Working on an existing OnlineMeeting:

$onlineMeeting = new OnlineMeeting();
$meetingParticipants = new MeetingParticipants();
$attendees = [];
$attendee = new MeetingParticipantInfo();
$attendee->setUpn('[email protected]')
$attendees[] = $attendee;
$meetingParticipants->setAttendees($attendees);
$onlineMeeting->setParticipants($meetingParticipants);

try {
  $response = $this->graphClient->users()->byUserId($userId)->onlineMeetings()->byOnlineMeetingId($eventId)->patch($onlineMeeting)->wait();
}
catch (Throwable $ex) {
}

this should be enough to catch it. Just FYI, I haven't run this code it might have issues!

I edited my initial comment with a simple solution that kinda highlights the issue as well.

@gkotsinos
Copy link
Author

Hi @gkotsinos ,thank you for trying out the SDK, I am currently looking into the issue. In the meantime, could you please provide the version of the SDK you are using and the code you are trying to run(if possible).

Hello, forgot to mention, I' m using the latest version of the SDK, Release 2.3.0

@SilasKenneth
Copy link
Member

Hi @gkotsinos, thanks for providing additional information.
I am able to reproduce the issue.
I am putting this as high priority so we get it fixed ASAP.
Sorry for the inconvenience.

@SilasKenneth
Copy link
Member

Hi @gkotsinos ,the issue is now resolved.
Please run composer update to update to the latest version of the serialization library.
Please feel free to re-open the issue if you're still facing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants