You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not entirely sure if this is the right place to post this, but I figured I'd start here.
I've encountered an issue when trying to retrieve the columns of a list from a SharePoint site using the Microsoft Graph API. Specifically, I'm using the query parameter expand=hidden to include hidden columns in the response.
According to the documentation, the request should look like this: https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/columns?expand=hidden
This works perfectly in the Graph Explorer. However, when I click on the Code snippets option in Graph Explorer, it suggests the following C# code for the request:
When I try this code in my project, the request executes as follows: https://graph.microsoft.com/v1.0/sites/…/columns?%24expand=hidden. This results in an error:
{
"error": {
"code": "BadRequest",
"message": "Parsing OData Select and Expand failed: Property 'hidden' on type 'microsoft.graph.columnDefinition' is not a navigation property or complex property. Only navigation properties can be expanded.",
"innerError": {
"date": "2024-10-10T19:19:00",
"request-id": "a",
"client-request-id": "7"
}
}
}
To solve this, I replaced the $ symbol with an empty string in the query parameter, and that seemed to work. However, this appears to be an issue with the SDK.
I believe this SDK is generated using Kiota, and I found an openapi.yaml file in this repository with the relevant configuration. My understanding is that the error might originate from this section:
'/sites/{site-id}/lists/{list-id}/columns':
description: Provides operations to manage the columns property of the microsoft.graph.list entity.get:
tags:
- sites.listsummary: List columnDefinitions in a listdescription: Get the collection of columns represented as columnDefinition resources in a list.externalDocs:
description: Find more info hereurl: https://learn.microsoft.com/graph/api/list-list-columns?view=graph-rest-1.0operationId: sites.lists.ListColumnsparameters:
- $ref: '#/components/parameters/top'
- $ref: '#/components/parameters/skip'
- $ref: '#/components/parameters/search'
- $ref: '#/components/parameters/filter'
- $ref: '#/components/parameters/count'
- name: $orderbyin: querydescription: Order items by property valuesstyle: formexplode: falseschema:
uniqueItems: truetype: arrayitems:
type: string
- name: $selectin: querydescription: Select properties to be returnedstyle: formexplode: falseschema:
uniqueItems: truetype: arrayitems:
type: string
- name: $expandin: querydescription: Expand related entitiesstyle: formexplode: falseschema:
uniqueItems: truetype: arrayitems:
type: string
It seems that the parameter name $expand might need to be specified without the $ symbol here.
I would appreciate any guidance on whether the request should be updated to work with or without the $ symbol and how to make the necessary adjustments. I'm also willing to help but need some direction on where exactly to make changes.
Thank you for your time and assistance!
The text was updated successfully, but these errors were encountered:
I'm not entirely sure if this is the right place to post this, but I figured I'd start here.
I've encountered an issue when trying to retrieve the columns of a list from a SharePoint site using the Microsoft Graph API. Specifically, I'm using the query parameter
expand=hidden
to include hidden columns in the response.According to the documentation, the request should look like this:
https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/columns?expand=hidden
This works perfectly in the Graph Explorer. However, when I click on the
Code snippets
option in Graph Explorer, it suggests the following C# code for the request:When I try this code in my project, the request executes as follows:
https://graph.microsoft.com/v1.0/sites/…/columns?%24expand=hidden
. This results in an error:To solve this, I replaced the
$
symbol with an empty string in the query parameter, and that seemed to work. However, this appears to be an issue with the SDK.I believe this SDK is generated using Kiota, and I found an
openapi.yaml
file in this repository with the relevant configuration. My understanding is that the error might originate from this section:It seems that the parameter name
$expand
might need to be specified without the$
symbol here.I would appreciate any guidance on whether the request should be updated to work with or without the
$
symbol and how to make the necessary adjustments. I'm also willing to help but need some direction on where exactly to make changes.Thank you for your time and assistance!
The text was updated successfully, but these errors were encountered: