daemon: JSON responses for API#546
Merged
Merged
Conversation
Member
Author
|
@mRabitsky would appreciate your thoughts on this one! |
Codecov Report
@@ Coverage Diff @@
## master #546 +/- ##
==========================================
+ Coverage 56.21% 56.37% +0.17%
==========================================
Files 60 61 +1
Lines 2991 3000 +9
==========================================
+ Hits 1681 1691 +10
- Misses 1102 1104 +2
+ Partials 208 205 -3
Continue to review full report at Codecov.
|
yaoharry
approved these changes
Feb 12, 2019
bobheadxi
added a commit
that referenced
this pull request
Feb 12, 2019
* chi (https://github.com/go-chi/chi) + chi middleware for routing needs * basic JSON structure for as many things as I could update without demolishing things (package `api` and package `res`) * update CLI and client as much as possible without radical changes for new API responses * minor refactors to package log (rename `Logger` to `Streamer`, update success and error funcs to take render.Renderer)
mRabitsky
reviewed
Feb 12, 2019
mRabitsky
left a comment
There was a problem hiding this comment.
Current state of the API looks good. Future considerations for the API may include standardizing it using either the OAS or RAML to declaritively specify our API and make it easier to work with considering the language barrier existing between the front/back-end.
Member
Author
|
@mRabitsky by OAS, do you mean Swagger? update: opened #556 to address this! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎟️ Ticket(s): Closes #502
👷 Changes
apiand packageres)Here's the idea - all responses should be structured like this:
Datais a json object of some sort. For example,loginresponse looks like:and
totp/enablelooks like:there's also a handy new utility for working with these responses clientside (not used much yet, but will leave for another PR):
This PR is gonna help out #109, #236, #389 and probably more
🔦 Testing Instructions
run tests
also run testenv and try out all the
inertia [remote]commands, they'll look ugly but... they shouldnt break (I hope 😋 )