Skip to content

add partial sharing response example and schema #154

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions api/openapi-spec/v1.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,30 @@ paths:
displayName: "Albert Einstein"
'@libre.graph.permissions.actions': [ "libre.graph/driveItem/basic/read", "libre.graph/driveItem/path/update" ]
'207':
# FIXME describe partial success response
description: Partial success response TODO
description: When partial success is returned, the response for each failed recipient will contain an error object with information about what went wrong and how to fix it.
content:
application/json:
schema:
$ref: '#/components/schemas/permission'
example:
value:
- id: "81d5bad3-3eff-410a-a2ea-eda2d14d4474"
roles: [ "7ccc2a61-9615-4063-a80a-eb7cd8e59d8" ]
grantedToV2:
- user:
id: "4c510ada-c86b-4815-8820-42cdf82c3d51"
displayName: "Albert Einstein"
error:
- code: notAllowed
message: Account verification needed to unblock sending emails.
Copy link
Member Author

@butonic butonic Dec 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is interesting to see that ms graph has two more properties:
one that contains a localized message that can be shown to the end user:

"localizedMessage": "Kontobestätigung erforderlich, um das Senden von E-Mails zu entsperren.",

Nothing for this PR, but this is how they move error localization to the server side.

And one that I assume is intendet to educate the end user.

"fixItUrl":"http://g.live.com/8SESkydrive/VerifyAccount",

In this case it is a link to the login page of onedrive.

Interestingly they have defined a list of errors clients should expect: https://learn.microsoft.com/en-us/graph/api/driveitem-invite?view=graph-rest-beta&tabs=http#sendnotification-errors

It seems they are running into exactly the same problem, even when they are 'just' trying to send out email and we are trying to persist perminssions in the share manager.

Oh and:

Note: The service can add new error codes or stop returning old ones at any time.

innerError:
code: accountVerificationRequired
- id: "b470677e-a7f5-4304-8ef5-f5056a21fff1"
roles: [ "7ccc2a61-9615-4063-a80a-eb7cd8e59d8" ]
grantedToV2:
- user:
id: "f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c"
displayName: "Marie Skłodowska Curie"
'400':
description: Bad request
content:
Expand Down Expand Up @@ -4095,6 +4117,9 @@ components:
'@UI.Hidden':
description: Properties or facets (see UI.Facet) annotated with this term will not be rendered if the annotation evaluates to true. Users can set this to hide permissons.
type: boolean
error:
description: An error describing what went wrong for this permission in a partial response. Optional. Read-only.
$ref: '#/components/schemas/odata.error'

# unused. We could put public link token in here, but we currently only need the link property, anyway
#shareId:
Expand Down