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
Document all API endpoints #271
Conversation
// description: Creates identity and stores in keystore encrypted with passphrase | ||
// parameters: | ||
// - in: body | ||
// name: body | ||
// description: Parameters for creating new identity | ||
// description: Parameter in body (passphrase) required for creating new identity |
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.
Do we need to specify "in body"? This is transport, we should not couple description to transport.
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.
In swagger template this message looks more informative
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.
yes we have, because doc describes payload body structure
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.
LGTM
315ad70
to
fcb426c
Compare
tequilapi/endpoints/connection.go
Outdated
func (ce *ConnectionEndpoint) Status(resp http.ResponseWriter, _ *http.Request, _ httprouter.Params) { | ||
statusResponse := toStatusResponse(ce.manager.Status()) | ||
utils.WriteAsJSON(statusResponse, resp) | ||
} | ||
|
||
// Creates starts new connection |
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.
should be "Create", shouldn't it be caught by linter? Did you run it?
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.
fixed, linter configured to have some tolerance
tequilapi/endpoints/health_check.go
Outdated
Version string `json:"version"` | ||
BuildInfo buildInfo `json:"buildInfo"` | ||
} | ||
|
||
type buildInfo struct { | ||
Commit string `json:"commit"` | ||
Branch string `json:"branch"` | ||
// example: <unknown> |
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.
Why this struct doesn't have "// swagger:model" heading?
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.
added missing meta tags
@@ -41,7 +41,7 @@ MESSAGES_ERROR=`golint --set_exit_status --min_confidence=1 ${ARGUMENTS} 2>/dev/ | |||
MESSAGES_RECONFIGURE=() | |||
|
|||
check_uncleaned_package "github.com/mysterium/node/identity" 9 | |||
check_uncleaned_package "github.com/mysterium/node/tequilapi" 12 | |||
check_uncleaned_package "github.com/mysterium/node/tequilapi" 11 |
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.
+1
tequilapi/endpoints/connection.go
Outdated
@@ -56,6 +56,26 @@ type statusResponse struct { | |||
SessionID string `json:"sessionId,omitempty"` | |||
} | |||
|
|||
// swagger:model | |||
type ipResponse struct { |
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.
Very strange that structures are private.
Lets make them public, because it is so.
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.
LGTM
No description provided.