Skip to content
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

OData system query options "format" not implemented #758

Open
JoAllg opened this issue Jun 14, 2024 · 2 comments
Open

OData system query options "format" not implemented #758

JoAllg opened this issue Jun 14, 2024 · 2 comments
Labels
area:documentation Focused on documentation of the product priority:p1 High priority/Major issue but not blocking or Big percentage of customers affected.Bug SLA <=7days status:needs-discussion An issue that requires more discussion internally before resolving type:bug A broken experience

Comments

@JoAllg
Copy link

JoAllg commented Jun 14, 2024

Describe the bug

In the documentation there is the Query "format" introduced that is supposed specify the media format that the requests returns.
Since the method is not implemented, the given example code for python throws an exception:

Traceback (most recent call last):
  File "/.../develop.py", line 37, in <module>
    query_params = UsersRequestBuilder.UsersRequestBuilderGetQueryParameters(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: UsersRequestBuilder.UsersRequestBuilderGetQueryParameters.__init__() got an unexpected keyword argument 'format'

Expected behavior

I would to be able to format the responses as needed. As a suboptimal solution the docs should not refer to nonexisting methods.

How to reproduce

from msgraph import GraphServiceClient
from msgraph.generated.users.users_request_builder import UsersRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration

query_params = UsersRequestBuilder.UsersRequestBuilderGetQueryParameters(
    format = "json",
)

request_configuration = RequestConfiguration(
    query_parameters = query_params,
)
async def work():
    return await graph_client.users.get(request_configuration = request_configuration)

response = asyncio.run(work())

SDK Version

1.4.0

@shemogumbe
Copy link
Collaborator

Looks like there is an issue with the SDK, tried the http call and it worked with the format filter - GET https://graph.microsoft.com/v1.0/users?$format=json

@shemogumbe shemogumbe added area:documentation Focused on documentation of the product status:needs-discussion An issue that requires more discussion internally before resolving priority:p1 High priority/Major issue but not blocking or Big percentage of customers affected.Bug SLA <=7days and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Jun 18, 2024
@pangzi499
Copy link

async def get_incident_by_id(client, incident_id):
from pprint import pprint as pp

x =  client.security.incidents.by_incident_id(incident_id)
# print(dir(x))
result = await client.security.incidents.by_incident_id(incident_id).get(request_configuration = request_configuration)
print(result)

Traceback (most recent call last):
File "/.../develop.py", line 37, in
query_params = UsersRequestBuilder.UsersRequestBuilderGetQueryParameters(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: UsersRequestBuilder.UsersRequestBuilderGetQueryParameters.init() got an unexpected keyword argument 'format'

I have the same question, is this repository still being updated? I don't seem to see that this issue will be resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:documentation Focused on documentation of the product priority:p1 High priority/Major issue but not blocking or Big percentage of customers affected.Bug SLA <=7days status:needs-discussion An issue that requires more discussion internally before resolving type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

3 participants