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

Quality of life string conversions for FgaObject #149

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

FedotCompot
Copy link
Contributor

Quality of life functions for FgaObject from and to string convesion

Using FGA on the backend, I found myself converting a lot between the two so I implemented these easy but handy helper functions. Also as a bonus makes FgaObject compatible with fmt.Stringer interface

func (o FgaObject) String() string
func FgaObjectFromString(s string) (*FgaObject, error)

Description

References

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

If you haven't done so yet, we would appreciate it if you could star the OpenFGA repository. :)

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.

Project coverage is 25.95%. Comparing base (8847b87) to head (55a9673).

Files with missing lines Patch % Lines
model_fga_object.go 0.00% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #149      +/-   ##
==========================================
- Coverage   25.98%   25.95%   -0.03%     
==========================================
  Files         102      102              
  Lines       12405    12418      +13     
==========================================
  Hits         3223     3223              
- Misses       8911     8924      +13     
  Partials      271      271              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@FedotCompot FedotCompot marked this pull request as ready for review November 28, 2024 16:43
@FedotCompot FedotCompot requested a review from a team as a code owner November 28, 2024 16:43
@FedotCompot
Copy link
Contributor Author

I am not so familiar with mustache so I was not able to update the sdk-generator

@rhamzeh
Copy link
Member

rhamzeh commented Nov 30, 2024

Hi @FedotCompot - thanks for adding this.

We'll take a look Monday or sometime early next week.

Most likely we'll have to move these out to their own utility file as the way they're modified here is incompatible with the generation - but we'll have better feedback after a closer look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants