-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add ref
missing parameter in content
endpoint
#58
Conversation
ref
missing parameter in content
ref
missing parameter in content
endpoint
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.
Is there a way that we can test this? Maybe testing that the Endpoint
has the correct parameters? Or maybe that's only worth doing if we need to special case a nil
ref.
Tentacle/Client.swift
Outdated
return "/repos/\(owner)/\(repository)/contents/\(path)" | ||
} | ||
} | ||
|
||
internal var queryItems: [URLQueryItem] { | ||
return [] | ||
switch self { | ||
case let .content(_, _, _, ref): return [URLQueryItem(name: "ref", value: ref)] |
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.
Does this behave correctly if ref
is nil
?
c7b5c7c
to
6a43ed9
Compare
Rebased and Added some tests for the Endpoint enum. ✌🏼 |
6a43ed9
to
0e0938f
Compare
Sources/Tentacle/Client.swift
Outdated
public func create(file: File, atPath path: String, in repository: Repository) -> SignalProducer<(Response, FileResponse), Error> { | ||
return send(file, to: .content(owner: repository.owner, repository: repository.name, path: path), using: .put) | ||
/// Create a file in a repository | ||
public func create(file: File, atPath path: String, in repository: Repository, in branch: String? = nil) -> SignalProducer<(Response, FileResponse), Error> { |
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.
These new parameters above should follow the API Design Guidelines: https://swift.org/documentation/api-design-guidelines/
Compensate for weak type information to clarify a parameter’s role.
@ikesyo is it better now? I used |
The current API doesn't allow you to get a content at a specific ref and this fixes it.