fix: inherit App error catalogs on generated routes without local errors
This commit is contained in:
41
examples/contracts/errorInheritance.api
Normal file
41
examples/contracts/errorInheritance.api
Normal file
@@ -0,0 +1,41 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user