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

Python snippets do not import request bodies correctly #1954

Open
jasonjoh opened this issue Feb 21, 2024 · 1 comment
Open

Python snippets do not import request bodies correctly #1954

jasonjoh opened this issue Feb 21, 2024 · 1 comment
Labels
area: snippets-generation Describes a required fix to the snippet generator

Comments

@jasonjoh
Copy link
Member

Context: https://github.com/microsoftgraph/microsoft-graph-docs-contrib/issues/9123

In the snippets the user reported, we see this line:

from msgraph.generated.models.provision_on_demand_post_request_body import ProvisionOnDemandPostRequestBody

This is invalid. The correct import statement is:

from msgraph.generated.service_principals.item.synchronization.jobs.item.provision_on_demand.provision_on_demand_post_request_body import ProvisionOnDemandPostRequestBody

This seems to be widespread across all Python snippets that use a special-purpose request body. For example, Send mail has:

from msgraph.generated.models.send_mail_post_request_body import SendMailPostRequestBody

But the correct line is:

from msgraph.generated.users.item.send_mail.send_mail_post_request_body import SendMailPostRequestBody

This is with msgraph-sdk 1.1.0

@mrutherford2
Copy link

I just encountered this issue as well with the Send mail documentation. Spent 30mins or so Googling and using ChatGPT with no luck until I stumbled across the issue here.

I really appreciate all the work that goes into maintaining this documentation and would be happy to submit a PR to help resolve this if I could determine where to submit this.

@millicentachieng millicentachieng added the area: snippets-generation Describes a required fix to the snippet generator label May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: snippets-generation Describes a required fix to the snippet generator
Projects
None yet
Development

No branches or pull requests

3 participants