Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"@odata.nextLink": "https://graph.microsoft.com/v1.0/groups/6257b47d-9e87-418b-9ac2-031f09397de7/drives?$top=1&$skiptoken=aWQ9OUZCRjU2OUEtN0UwOC00RDFELTlFREMtMkY3ODg3MTUzNjY3",
"value": [
{
"id": "b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
"driveType": "documentLibrary",
"createdDateTime": "2017-07-27T02:41:36Z",
"createdBy": {
"user": {
"id": "CE251278-EF9E-4FE5-833C-1D89EEAE68E0",
"displayName": "Ryan Gregg",
"email": "ryan@contoso.com"
}
},
"lastModifiedDateTime": "2018-03-27T07:34:38Z",
"lastModifiedBy": {
"user": {
"id": "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
"displayName": "Dana Lee",
"email": "dana@contoso.com"
}
}
},
{
"id": "b!kjtJnMGCeEeNkZsY18PtOiNjCV0Z9s9Fqyly8jKvPEB2kal9T5pOT5y7TXClirlE",
"driveType": "documentLibrary",
"system": {},
"createdDateTime": "2017-07-27T02:41:36Z",
"createdBy": {
"user": {
"id": "CE251278-EF9E-4FE5-833C-1D89EEAE68E0",
"displayName": "Ryan Gregg",
"email": "ryan@contoso.com"
}
},
"lastModifiedDateTime": "2017-07-27T02:41:36Z",
"lastModifiedBy": {
"user": {
"id": "CE251278-EF9E-4FE5-833C-1D89EEAE68E0",
"displayName": "Ryan Gregg",
"email": "ryan@contoso.com"
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"@odata.nextLink": "https://graph.microsoft.com/v1.0/users/6257b47d-9e87-418b-9ac2-031f09397de7/drives?$top=1&$skiptoken=aWQ9OUZCRjU2OUEtN0UwOC00RDFELTlFREMtMkY3ODg3MTUzNjY3",
"value": [
{
"id": "b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"@odata.nextLink":"https://graph.microsoft.com/v1.0/groups/6257b47d-9e87-418b-9ac2-031f09397de7/drives?$top=1&$skiptoken=aWQ9OUZCRjU2OUEtN0UwOC00RDFELTlFREMtMkY3ODg3MTUzNjY3",
"value":[
{
"id":"b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
"driveType":"documentLibrary",
"createdDateTime":"2017-07-27T02:41:36Z",
"createdBy":{
"user":{
"id":"CE251278-EF9E-4FE5-833C-1D89EEAE68E0",
"email":"t~rhHXsIpQCoOYdgzj6URY4x8oUcvnLMLR5d71_wRuVAA@contoso.com"
}
},
"lastModifiedDateTime":"2018-03-27T07:34:38Z",
"lastModifiedBy":{
"user":{
"id":"9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
"email":"t~1ECTeY42RlWDU6D4DtrXKyFmVrUHbEEpdYzI34l0y9Q@contoso.com"
}
}
},
{
"id":"b!kjtJnMGCeEeNkZsY18PtOiNjCV0Z9s9Fqyly8jKvPEB2kal9T5pOT5y7TXClirlE",
"driveType":"documentLibrary",
"system":{ },
"createdDateTime":"2017-07-27T02:41:36Z",
"createdBy":{
"user":{
"id":"CE251278-EF9E-4FE5-833C-1D89EEAE68E0",
"email":"t~rhHXsIpQCoOYdgzj6URY4x8oUcvnLMLR5d71_wRuVAA@contoso.com"
}
},
"lastModifiedDateTime":"2017-07-27T02:41:36Z",
"lastModifiedBy":{
"user":{
"id":"CE251278-EF9E-4FE5-833C-1D89EEAE68E0",
"email":"t~rhHXsIpQCoOYdgzj6URY4x8oUcvnLMLR5d71_wRuVAA@contoso.com"
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"@odata.nextLink":"https://graph.microsoft.com/v1.0/users/6257b47d-9e87-418b-9ac2-031f09397de7/drives?$top=1&$skiptoken=aWQ9OUZCRjU2OUEtN0UwOC00RDFELTlFREMtMkY3ODg3MTUzNjY3",
"value":[
{
"id":"b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"@odata.nextLink":"https://graph.microsoft.com/v1.0/groups/6257b47d-9e87-418b-9ac2-031f09397de7/drives?$top=1&$skiptoken=aWQ9OUZCRjU2OUEtN0UwOC00RDFELTlFREMtMkY3ODg3MTUzNjY3",
"value":[
{
"id":"b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"@odata.nextLink":"https://graph.microsoft.com/v1.0/users/p~G-O6qnggmabXX7oVLICcae1h1B_h3yud3zcNymQoGVqSOg0H9jqiKau9wvs7oToujvTK_Woudb8vCT95nqMWc89UQSbrUBZGukrZoydhHl8/drives?$top=1&$skiptoken=aWQ9OUZCRjU2OUEtN0UwOC00RDFELTlFREMtMkY3ODg3MTUzNjY3",
"value":[
{
"id":"b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
"driveType":"documentLibrary",
"createdDateTime":"2017-07-27T02:41:36Z",
"createdBy":{
"user":{
"id":"t~jL-PZwZ7AqMLlWzY4F0nkDdSpci8cF1GzIzZC51Y9Rg",
"email":"t~rhHXsIpQCoOYdgzj6URY4x8oUcvnLMLR5d71_wRuVAA@contoso.com"
}
},
"lastModifiedDateTime":"2018-03-27T07:34:38Z",
"lastModifiedBy":{
"user":{
"id":"t~DTbvYdTNRIQXAF1SvLNyAIENog0-Dy0dxTEB2Yoo5Ys",
"email":"t~1ECTeY42RlWDU6D4DtrXKyFmVrUHbEEpdYzI34l0y9Q@contoso.com"
}
}
},
{
"id":"b!kjtJnMGCeEeNkZsY18PtOiNjCV0Z9s9Fqyly8jKvPEB2kal9T5pOT5y7TXClirlE",
"driveType":"documentLibrary",
"system":{ },
"createdDateTime":"2017-07-27T02:41:36Z",
"createdBy":{
"user":{
"id":"t~jL-PZwZ7AqMLlWzY4F0nkDdSpci8cF1GzIzZC51Y9Rg",
"email":"t~rhHXsIpQCoOYdgzj6URY4x8oUcvnLMLR5d71_wRuVAA@contoso.com"
}
},
"lastModifiedDateTime":"2017-07-27T02:41:36Z",
"lastModifiedBy":{
"user":{
"id":"t~jL-PZwZ7AqMLlWzY4F0nkDdSpci8cF1GzIzZC51Y9Rg",
"email":"t~rhHXsIpQCoOYdgzj6URY4x8oUcvnLMLR5d71_wRuVAA@contoso.com"
}
}
}
]
}
28 changes: 28 additions & 0 deletions docs/sources/microsoft-365/msft-onedrive/msft-onedrive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,34 @@ endpoints:
type: "array"
items:
$ref: "#/definitions/DriveItem"
# OData function-call continuation shape for /root/delta, eg "/root/delta(token=abc123)"
- pathTemplate: "/v1.0/drives/{driveId}/root/{deltaExpression}"
allowedQueryParams:
- "token"
- "$select"
- "$expand"
- "$top"
transforms:
- !<pseudonymize>
jsonPaths:
- "$..user.email"
encoding: "URL_SAFE_TOKEN"
pathParameterSchemas:
deltaExpression:
pattern: "^delta\\(token=[^)]+\\)$"
responseSchema:
type: "object"
properties:
'@microsoft.graph.hasMoreData':
type: "boolean"
'@odata.deltaLink':
type: "string"
'@odata.nextLink':
type: "string"
value:
type: "array"
items:
$ref: "#/definitions/DriveItem"
- pathTemplate: "/v1.0/groups"
allowedQueryParams:
- "$top"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,35 @@ endpoints:
type: "array"
items:
$ref: "#/definitions/DriveItem"
# OData function-call continuation shape for /root/delta, eg "/root/delta(token=abc123)"
- pathTemplate: "/v1.0/drives/{driveId}/root/{deltaExpression}"
allowedQueryParams:
- "token"
- "$select"
- "$expand"
- "$top"
transforms:
- !<pseudonymize>
jsonPaths:
- "$..user.id"
- "$..user.email"
encoding: "URL_SAFE_TOKEN"
pathParameterSchemas:
deltaExpression:
pattern: "^delta\\(token=[^)]+\\)$"
responseSchema:
type: "object"
properties:
'@microsoft.graph.hasMoreData':
type: "boolean"
'@odata.deltaLink':
type: "string"
'@odata.nextLink':
type: "string"
value:
type: "array"
items:
$ref: "#/definitions/DriveItem"
- pathTemplate: "/v1.0/groups"
allowedQueryParams:
- "$top"
Expand Down Expand Up @@ -176,6 +205,10 @@ endpoints:
- "$..user.id"
- "$..user.email"
encoding: "URL_SAFE_TOKEN"
- !<tokenize>
jsonPaths:
- "$.['@odata.nextLink']"
regex: "^https://graph.microsoft.com/v1.0/users/([a-zA-Z0-9_-]+)/.*$"
pathParameterSchemas:
userId:
anyOf:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,21 @@ public Stream<InvocationExample> getExamples() {
InvocationExample.of(baseEndpoint + "/groups", "groups.json"),
InvocationExample.of(baseEndpoint + "/groups?$top=999&$select=id,mail&$skiptoken=abcXYZ123&$orderby=id&$count=true", "groups.json"),
// /v1.0/users/{userId}/drives - no query params, and with all allowed query params
InvocationExample.of(baseEndpoint + "/users/" + userId + "/drives", "list_drives.json"),
InvocationExample.of(baseEndpoint + "/users/" + userId + "/drives?$select=id,driveType,system&$skiptoken=abcXYZ123&$top=999&$orderby=id&$expand=root", "list_drives.json"),
// (with app ids visible, fixture's @odata.nextLink is passed through unmodified -- no
// pathParameterSchemas constraint on userId in this rule variant)
InvocationExample.of(baseEndpoint + "/users/" + userId + "/drives", "list_user_drives.json"),
InvocationExample.of(baseEndpoint + "/users/" + userId + "/drives?$select=id,driveType,system&$skiptoken=abcXYZ123&$top=999&$orderby=id&$expand=root", "list_user_drives.json"),
// /v1.0/groups/{groupId}/drives - no query params, and with all allowed query params
InvocationExample.of(baseEndpoint + "/groups/" + groupId + "/drives", "list_drives.json"),
InvocationExample.of(baseEndpoint + "/groups/" + groupId + "/drives?$select=id,driveType,system&$skiptoken=abcXYZ123&$top=999&$orderby=id&$expand=root", "list_drives.json"),
InvocationExample.of(baseEndpoint + "/groups/" + groupId + "/drives", "list_groups_drives.json"),
InvocationExample.of(baseEndpoint + "/groups/" + groupId + "/drives?$select=id,driveType,system&$skiptoken=abcXYZ123&$top=999&$orderby=id&$expand=root", "list_groups_drives.json"),
// /v1.0/drives/{driveId}/root/delta - no query params, and with all allowed query params
InvocationExample.of(baseEndpoint + "/drives/" + driveId + "/root/delta", "get_drive_delta.json"),
// real pagination continuation shape confirmed via live testing against the Graph API
// (a "?token=..." query param, matching MSFT's own docs example)
InvocationExample.of(baseEndpoint + "/drives/" + driveId + "/root/delta?token=abcXYZ123&", "get_drive_delta.json"),
// the OTHER real continuation shape, from this fixture's own captured @odata.nextLink
// (an OData function-call path segment -- rules must accept both)
InvocationExample.of(baseEndpoint + "/drives/" + driveId + "/root/delta(token=1230919asd190410jlka)", "get_drive_delta.json"),
// /v1.0/drives/{driveId}/items/{itemId}/activities - no query params allowed by rules
InvocationExample.of(baseEndpoint + "/drives/" + driveId + "/items/" + itemId + "/activities", "list_itemActivity.json"),
InvocationExample.of(baseEndpoint + "/drives/" + driveId + "/items/" + itemId + "/activities?$expand=driveItem", "list_itemActivity.json"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,22 @@ public Stream<InvocationExample> getExamples() {
InvocationExample.of(baseEndpoint + "/groups", "groups.json"),
InvocationExample.of(baseEndpoint + "/groups?$top=999&$select=id,mail&$skiptoken=abcXYZ123&$orderby=id&$count=true", "groups.json"),
// /v1.0/users/{userId}/drives - no query params, and with all allowed query params
InvocationExample.of(baseEndpoint + "/users/" + userId + "/drives", "list_drives.json"),
InvocationExample.of(baseEndpoint + "/users/" + userId + "/drives?$select=id,driveType,system&$skiptoken=abcXYZ123&$top=999&$orderby=id&$expand=root", "list_drives.json"),
// (fixture's @odata.nextLink embeds the raw, un-pseudonymized AAD user id that Graph
// resolves the path to; it must be re-tokenized so a client following the link isn't
// blocked by pathParameterSchemas requiring a reversible-pseudonym userId)
InvocationExample.of(baseEndpoint + "/users/" + userId + "/drives", "list_user_drives.json"),
InvocationExample.of(baseEndpoint + "/users/" + userId + "/drives?$select=id,driveType,system&$skiptoken=abcXYZ123&$top=999&$orderby=id&$expand=root", "list_user_drives.json"),
// /v1.0/groups/{groupId}/drives - no query params, and with all allowed query params
InvocationExample.of(baseEndpoint + "/groups/" + groupId + "/drives", "list_drives.json"),
InvocationExample.of(baseEndpoint + "/groups/" + groupId + "/drives?$select=id,driveType,system&$skiptoken=abcXYZ123&$top=999&$orderby=id&$expand=root", "list_drives.json"),
InvocationExample.of(baseEndpoint + "/groups/" + groupId + "/drives", "list_groups_drives.json"),
InvocationExample.of(baseEndpoint + "/groups/" + groupId + "/drives?$select=id,driveType,system&$skiptoken=abcXYZ123&$top=999&$orderby=id&$expand=root", "list_groups_drives.json"),
// /v1.0/drives/{driveId}/root/delta - no query params, and with all allowed query params
InvocationExample.of(baseEndpoint + "/drives/" + driveId + "/root/delta", "get_drive_delta.json"),
// real pagination continuation shape confirmed via live testing against the Graph API
// (a "?token=..." query param, matching MSFT's own docs example)
InvocationExample.of(baseEndpoint + "/drives/" + driveId + "/root/delta?token=abcXYZ123&", "get_drive_delta.json"),
// the OTHER real continuation shape, from this fixture's own captured @odata.nextLink
// (an OData function-call path segment -- rules must accept both)
InvocationExample.of(baseEndpoint + "/drives/" + driveId + "/root/delta(token=1230919asd190410jlka)", "get_drive_delta.json"),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

mmmm ... OK; so I can see why this would need to be a regex; f'ing msft.

still possibly as a template the following would work?

pathTemplate: "/v1.0/drives/{driveId}/root/{deltaExpression}"

then could add paramSpec for deltaExpression that enforces pattern just against that portion - which may be simpler. something like ^delta\(token=\D+\)$?

but nice-to-have imho.

might require a second endpoint spec for the other case:

pathTemplate: "/v1.0/drives/{driveId}/root/delta" as before

I think duplication preferable to single regex that is hard to read (and thus hard to be certain that it's obviously correct)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The funny thing is that while doing onedrive I've never faced the delta in path, that's something spotted while doing tests on #1401. And it is not clear why in the docs it says that delta is part of the path meanwhile it says that it could be a parameter https://learn.microsoft.com/en-us/graph/api/driveitem-delta?view=graph-rest-1.0&tabs=http#example-3-retrieving-the-current-deltalink, which it makes sense (besides that this what I see in the graph tests I have) because it is how it works ALL endpoints in graph.

// /v1.0/drives/{driveId}/items/{itemId}/activities - no query params allowed by rules
InvocationExample.of(baseEndpoint + "/drives/" + driveId + "/items/" + itemId + "/activities", "list_itemActivity.json"),
InvocationExample.of(baseEndpoint + "/drives/" + driveId + "/items/" + itemId + "/activities?$expand=driveItem", "list_itemActivity.json"),
Expand Down
Loading