Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,20 @@ object JsonPayloadValidatorSpec extends FunSuite {
|}
|
|structure OpInput {
| @required
| @jsonRpcPayload
| data: String
|}
|
|structure OpOutput {
| @required
| @jsonRpcPayload
| data: String
|}
|
|@error("client")
|structure OpError {
| @required
| @jsonRpcPayload
| data: String
|}
Expand Down Expand Up @@ -76,6 +79,7 @@ object JsonPayloadValidatorSpec extends FunSuite {
|}
|
|structure NestedStructure {
| @required
| @jsonRpcPayload
| data: String
|}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ string jsonRpcNotification

/// Binds a single structure member to the payload of a jsonrpc message.
/// Just like @httpPayload, but for jsonRpc.
@trait(selector: "structure > member", structurallyExclusive: "member")
@trait(selector: "structure > member[trait|required]", structurallyExclusive: "member")
@traitValidators({
"jsonRpcPayload.OnlyTopLevel": {
message: "jsonRpcPayload can only be used on the top level of an operation input/output/error.",
severity: "ERROR",
"jsonRpcPayload.OnlyTopLevel": {
message: "jsonRpcPayload can only be used on the top level of an operation input/output/error.",
severity: "ERROR",
selector: "$allowedShapes(:root(operation -[input, output, error]-> structure > member)) :not(:in(${allowedShapes}))"
}
})
Expand Down
Loading