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

README: add import and client initialization as comments for each code block #28

Closed
2 tasks
Tracked by #126
adriantam opened this issue Jun 9, 2023 · 4 comments
Closed
2 tasks
Tracked by #126
Assignees
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@adriantam
Copy link
Member

In the SDK README, for each code block examples, it will be helpful if

  • import modules are noted as comments
  • client initialization are noted as comments

For example,

body = CreateStoreRequest(
    name = "FGA Demo Store",
)
response = await fga_client.create_store(body)
# response.id = "01FQH7V8BEG3GPQW93KTRFR8JB"

should be

#from openfga_sdk.client import OpenFgaClient
#from openfga_sdk.models.create_store_request import CreateStoreRequest

# initialize fga_client
body = CreateStoreRequest(
    name = "FGA Demo Store",
)
response = await fga_client.create_store(body)
# response.id = "01FQH7V8BEG3GPQW93KTRFR8JB"

We want to do this for the examples listed in https://github.com/openfga/python-sdk/blob/main/README.md. Ideally, we will also fix the SDK generator so that newly generated python SDKs will have the corresponding changes. This is tracked as openfga/sdk-generator#126. However, if that is difficult to do, simply focusing on the Python SDK side https://github.com/openfga/python-sdk/blob/main/README.md will help us as well.

@JRudransh
Copy link
Contributor

Please assign it to me

@JRudransh
Copy link
Contributor

Any Update on my PR?

@rhamzeh
Copy link
Member

rhamzeh commented Jan 17, 2024

Thanks for the PR @JRudransh - we won't get to reviewing it this week as the team is busy in an offsite, but we'll be taking a look early next week.

@JRudransh
Copy link
Contributor

PR #63 Fixes this Issue

@rhamzeh rhamzeh closed this as completed Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants