-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
fix: #704 max-depth
not optional.
#755
Conversation
max-depth
not optional.max-depth
not optional.
Further, please add a test that checks whether the right code is returned. keto/internal/expand/handler.go Lines 55 to 56 in 4e65c14
You will find other definitions that do that, so please look up the right way to do this. The parameter is not marked as required in the docs (anymore?): https://www.ory.sh/keto/docs/reference/rest-api/#operation/getExpand |
As you're planning on making it required I'll make necessary changes as you suggested. This would make things more clearer :)
Ok. I'm new to test driven development area. I will try. Also, side note, should I change the documentation files too to reflect the changes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking pretty good already 👍
Did you find any docs pages that need to be updated except for the API reference? That one is automatically rendered from the openapi schema, which is autogenerated from the code and comments. So should be enough to just adjust the annotations.
Hm. I'll squash those commits into one single commit to not mess up your codebase :) |
d0288d7
to
28e864d
Compare
Fix ory#704 is not an optional parameter. Added error handlers,(handler.go#L80) docs and tests(ehandler_tests.go#L38). Fix sdkClient maxDepth pointer. Rebased Commit history.
28e864d
to
9b6d946
Compare
I've rebased into one single commit. Tests should work now :) I'm sorry for turning the git commits. I'm new to PRs thank you for your patient with me :) |
Quote test strings to match errors
Ok. All checks seems to have passed. Thank You for being patient with me. I'm new to PRs. I'm still learning please excuse my commits. I'm very sorry for taking so much time. I had a question and I feel like you're a great developer who can answer. How does one test their code offline before making PR? Everytime I push I see the CI takes over and runs the checks for me. Is it possible to run tests offline? |
Don't worry, I will squash-merge anyways 😉 Sure, you can run tests locally. We even have a section about that in the README 😂 https://github.com/ory/keto#running-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks perfect now, thank you 🎉
Fix #704
max-depth
not working as optional as mentioned in docs.Related issue(s)
#704
Checklist
contributing code guidelines.
vulnerability. If this pull request addresses a security. vulnerability, I
confirm that I got green light (please contact
[email protected]) from the maintainers to push
the changes.
works.
Further Comments
This patch fixes issue #704 where
max-depth
parameter appears to be causing http errors (HTTP 400).This patch reads the query parameter
max-depth
into variabled_
and checks if query parameter was not provided before throwing http error.I hope you will review my PR soon, and accept it for Hacktoberfest. Happy Hacktoberfest :)