-
Notifications
You must be signed in to change notification settings - Fork 209
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
daemon: the output format for api #376
Comments
do we need to return code inside response body? Cuz we can directly set HTTP status code |
We could define some codes to represent some special error types. |
@rickycao-qy - I think we can also use some custom status code to indicate errors in our plugins. 1 -> Data Collect Error |
Why not using HTTP Message and StatusCode instead? HTTP provides the extensible way for code and messages, see https://tools.ietf.org/html/rfc2616#section-6.1.1. |
Depend on how we define the message. If we defined the error code and message is application-level, put them into the header is reasonable, or they work on business-level, then body is better. |
HTTP is the application-level protocol, and the current definition looks a little bit duplicated. |
Yea, the message and code we needed looks more like a business information, the error expressed in http code is a little abstract to a business api. |
Shall we have a design in a more specific problem, just like we can list the request/response schema of all renew APIs, therefore some potential standard formats will be vivid? |
Another specific TODO before proposing the design is to list all errors and corresponding codes/message pairs just like what you were doing at #376 (comment). |
We can list some errors, and confirm how they can be defined or if they should be defined. |
That's it, looking forward to that! |
Actually, the {
"message": "something error",
"error": {
"type": "resource",
"code": "pipeline_not_exists"
}
} with |
What does the |
Just more detail for the error, it can be any field needed. |
I think we need versioning for the daemon api. |
I don't think the API versioning should be included at Pipcook, it depends on users IMO. |
Without versioning, once the apis used by any user, the api will be frozen. |
We are not to bind the service and client, the developer is able to deploy what they prefer to choose, and using the corresponding SDK. And maintaining multiple versions in single branch is hard, too. |
May be define some error code for product is better, such as |
@Txiaozhe The custom-code will be set to the http message, if need. Refer to Github API |
Current output data format:
There are some problems:
data
field is destructed, so the output data is dispersed, which makes the client a little cumbersome to handle.What I prefer:
Output data format:
data
struct is defined by specific apis.The text was updated successfully, but these errors were encountered: