feat: release v0.26 portable i18n and presentation adapters
This commit is contained in:
34
examples/contracts/i18n.api
Normal file
34
examples/contracts/i18n.api
Normal file
@@ -0,0 +1,34 @@
|
||||
syntax = "v1"
|
||||
|
||||
errorCatalog CommonErrors (
|
||||
defaultStatus: 200
|
||||
errors: {
|
||||
"LimitExceeded": {
|
||||
"key": "LIMIT_EXCEEDED", "code": 400001,
|
||||
"message": "Limit: {max}",
|
||||
"params": [{"name":"max","type":"int64","example":100}],
|
||||
"translation": {"namespace":"limits","key":"exceeded"}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
response CommonResponse (
|
||||
codeType: int32
|
||||
successCode: 0
|
||||
errorCode: 9999
|
||||
body: {"code":"${code}", "detail":"${message}", "ok":"${ok}"}
|
||||
)
|
||||
|
||||
type ValueResponse {
|
||||
Value string `json:"value"`
|
||||
}
|
||||
|
||||
@server (
|
||||
group: limits
|
||||
response: CommonResponse
|
||||
errors: LimitExceeded
|
||||
)
|
||||
service localized-api {
|
||||
@handler value
|
||||
get /value returns (ValueResponse)
|
||||
}
|
||||
Reference in New Issue
Block a user