-
Notifications
You must be signed in to change notification settings - Fork 6
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
OsoClass decorator unclear #432
Comments
Thanks for posting this! Let's try and update the documentation on this. Want to take a stab at it? |
I would love to help updating this. First: i think we can start by mentioning registered classes would need to imported in the app.module as provider |
i added some basic suggestions how the docs could be improved reguarding this issue |
I have started researching how I would use oso with Nest and came across https://github.com/osohq/oso-nest-doc-mgmt - this might be helpful to others as a reference. |
Would it make sense to create an example like the one @edgahan referenced? By the way, @weshuiz, I would love to see a repository where you have implemented Documentation is complicated, but I think we're better served if someone who finds them lacking updates it. |
The documentation for the @OsoClass decorator could be explained in more detail. Firstly, how is this decorator used? Nest and Oso need to be aware of its existence, and I assume that classes using the decorator need to be imported. Through trial and error, I figured out that it needs to be provided in the app.module, but nothing was mentioned about this, and I'm not even sure if this is the correct method.
Secondly, registered Oso classes need to have actual values set, which isn't done correctly either. Instead, we get this:
Thirdly, the @OsoClass decorator does not allow constructors with a value argument in them, which could have been mentioned, or at least given as a heads up.
Lastly, wouldn't it be nice if a guard were provided instead of expecting us to always write it ourselves?
Sincerely, someone who spent months figuring out these flaws on their own because the documentation was non-existent.
PS: No wonder people prefer Stack Overflow over using official docs (clasic meme)
The text was updated successfully, but these errors were encountered: