Skip to content

Creating event fails with sdk 6.4.0 on Android: Post body empty #1872

Description

@slowcar

I am creating an event using graph sdk 6.4.0 on Android.
The call is unchanged except for the api change - byCalenderId(folderId) instead of calendars(folderId)

createdEvent = graphClient.me().calendars().byCalendarId(folderId).events().post(event);

Expected behavior

The created event is returned.

Actual behavior

A http 400 Bad Request is thrown with the message "Empty Payload. JSON content expected."

The logger shows the posted json but states that the body is -1 byte
Here is the (redacted) log:

--> POST https://graph.microsoft.com/v1.0/me/calendars/[folderId]/events
authorization: Bearer [...]
accept: application/json
content-type: application/json
SdkVersion: graph-java, graph-java-core/3.1.5 (featureUsage=1203; android/29)
client-request-id: [...]
User-Agent: kiota-java/1.0.0

{"changeKey":null,"id":null,"@odata.type":"#microsoft.graph.event","attendees":[],"body":{"content":"","contentType":"html"},"end":{"dateTime":"2024-03-04T11:00:00.000","timeZone":"W. Europe Standard Time"},"isAllDay":false,"isOnlineMeeting":true,"isReminderOn":true,"location":{"displayName":"Microsoft Teams"},"onlineMeetingProvider":"teamsForBusiness","reminderMinutesBeforeStart":15,"showAs":"busy","start":{"dateTime":"2024-03-04T10:00:00.000","timeZone":"W. Europe Standard Time"},"subject":"onl"}
--> END POST (-1-byte body)

Steps to reproduce the behavior

Create an event with the sdk on Android

Activity

  1. baywet commented on Mar 4, 2024

    @baywet
    Member

    Hi slowcar
    Thank you for reporting this, it's probably a side effect of this PR microsoft/kiota-java#1088
    Can you please confirm the kiota http version in use is 1.0.5 please?
    I've authored microsoft/kiota-java#1109 to default base to the native behaviour when the overrides we've implemented do not return anything.

  2. slowcar commented on Mar 4, 2024

    @slowcar
    Author
    groupId: "com.microsoft.kiota"
    artifactId: "microsoft-kiota-http-okHttp"
    version: "1.0.4"
    
  3. baywet commented on Mar 4, 2024

    @baywet
    Member

    can you try to force it to 1.0.5 please?

  4. slowcar commented on Mar 4, 2024

    @slowcar
    Author

    unfortunately the error still occurs with all kiota libraries added as 1.0.5

  5. baywet commented on Mar 4, 2024

    @baywet
    Member

    That was my suspicion, thanks for confirming. For sanity, it's not happening when forcing to 1.0.3, correct?

  6. slowcar commented on Mar 4, 2024

    @slowcar
    Author

    I can't downgrade as the regex pattern error rears its head with 6.3.0
    As 6.4.0 already contains the dependency to 1.0.4 manually adding the 1.0.3 dependency does nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions