42 lines
847 B
Plaintext
42 lines
847 B
Plaintext
syntax = "v1"
|
|
|
|
// Errors are registered once in Go with omni.WithErrors.
|
|
response CommonResponse (
|
|
codeType: int32
|
|
successCode: 0
|
|
errorCode: 9999
|
|
body: {"code": "${code}", "msg": "${message}", "data": "${data}"}
|
|
dataMode: always
|
|
)
|
|
|
|
type CheckRequest {
|
|
Kind string `form:"kind,optional"`
|
|
}
|
|
type CheckResponse {
|
|
OK bool `json:"ok"`
|
|
}
|
|
|
|
@server (
|
|
group: account
|
|
response: CommonResponse
|
|
)
|
|
service inherited-errors-api {
|
|
@handler plain
|
|
get /plain (CheckRequest) returns (CheckResponse)
|
|
|
|
@response raw
|
|
@handler raw
|
|
get /raw (CheckRequest) returns (CheckResponse)
|
|
|
|
@errors none
|
|
@handler cleared
|
|
get /cleared (CheckRequest) returns (CheckResponse)
|
|
|
|
@handlerMode manual
|
|
@body (mode: raw
|
|
maxBytes: 64)
|
|
@produces "text/plain"
|
|
@handler bounded
|
|
post /bounded
|
|
}
|