-
Notifications
You must be signed in to change notification settings - Fork 3
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
Complete all methods #6
base: master
Are you sure you want to change the base?
Conversation
dukenguyenxyz
commented
Mar 8, 2021
•
edited
Loading
edited
- Use enums instead of strings
- Complete specs
struct PutResponse < Base | ||
getter header : Header | ||
struct PutResponse < WithHeader | ||
# Why is this nillable | ||
getter prev_kv : Kv? |
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.
Nillable because the previous is only included if you ask for the previous kv.
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.
And it might not be present
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.
Theres no nillable type marking on the openapi specs, makes everything a bit more confusing than it should be
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.
I think you should work against the API rather than the spec. I remember it not being consistent.
src/etcd/auth.cr
Outdated
end | ||
|
||
private def validate!(name : String) | ||
raise ArgumentError.new("Arg name is empty") if name.empty? |
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.
You can put an always inline annotation above this. That will inline the code (i.e. just drop the method inline in the method, reducing the overhead of a method call (i.e. setting up a stack)
The message is also a little vague. Something closer to the message below would be preferrable.
Argument `name` is empty.
bd873e2
to
b43427e
Compare
Authored By: Duke Nguyen <[email protected]> Co-Authored By: Caspian Baska <[email protected]>
b43427e
to
e1974f0
Compare