msgraph-sdk-typescript icon indicating copy to clipboard operation
msgraph-sdk-typescript copied to clipboard

Missing put request – snippets Expect a put request but only a patch exists

Open rkodev opened this issue 3 years ago • 3 comments

Request Builder is missing a PUT request method. Only Patch is available

Sample Link Go: https://docs.microsoft.com/en-us/graph/api/shift-put?view=graph-rest-beta&tabs=go

Example

Expected


const requestBody1 : Shift = {
    lastModifiedBy : {
        application : null,
        device : null,
        conversation : null,
        user : {
            id : "366c0b19-49b1-41b5-a03f-9f3887bd0ed8",
            displayName : "John Doe",
        },
    },
    sharedShift : {
        displayName : "Day shift",
        notes : "Please do inventory as part of your shift.",
        startDateTime : "2019-03-11T15:00:00Z",
        endDateTime : "2019-03-12T00:00:00Z",
        theme : "blue",
        activities : [
            {
                isPaid : true,
                startDateTime : "2019-03-11T15:00:00Z",
                endDateTime : "2019-03-11T15:15:00Z",
                code : "",
                displayName : "Lunch",
            },
        ],
    },
    draftShift : {
        displayName : "Day shift",
        notes : "Please do inventory as part of your shift.",
        startDateTime : "2019-03-11T15:00:00Z",
        endDateTime : "2019-03-12T00:00:00Z",
        theme : "blue",
        activities : [
            {
                isPaid : true,
                startDateTime : "2019-03-11T15:00:00Z",
                endDateTime : "2019-03-11T15:30:00Z",
                code : "",
                displayName : "Lunch",
            },
        ],
    },
    additionalData : {
        "id" : "SHFT_577b75d2-a927-48c0-a5d1-dc984894e7b8",
        "createdDateTime" : "2019-03-14T04:32:51.451Z",
        "lastModifiedDateTime" : "2019-03-14T05:32:51.451Z",
        "userId" : "c5d0c76b-80c4-481c-be50-923cd8d680a1",
        "schedulingGroupId" : "TAG_228940ed-ff84-4e25-b129-1b395cf78be0",
    },
};

async () => {
    await graphServiceClient.teamsById("team-id").schedule.shiftsById("shift-id").put(requestBody1);
}


rkodev avatar May 30 '22 13:05 rkodev

cc @baywet

rkodev avatar May 30 '22 13:05 rkodev

This one is missing from the OpenAPI description all together. From looking at the CSDL I'd say it's actually missing an annotation that says it's updatable by PUT (can't remember the exact name here). @irvinesunday might be able to help out on this.

baywet avatar May 30 '22 13:05 baywet

@rkodev can you create an associated issue in the metadata repo, we'll be able to add the annotation there and fix the issue across the SDKs this way. Thanks

baywet avatar Jan 26 '24 16:01 baywet