Skip to content

Commit 8eee63e

Browse files
committed
Fix missing renames
1 parent 074fb87 commit 8eee63e

File tree

6 files changed

+61
-61
lines changed

6 files changed

+61
-61
lines changed

modules/smithy-tests/src/test/scala/jsonrpclib/JsonNotificationOutputValidatorSpec.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ object JsonNotificationOutputValidatorSpec extends FunSuite {
1313
"""$version: "2"
1414
|namespace test
1515
|
16-
|use jsonrpclib#jsonNotification
16+
|use jsonrpclib#jsonRpcNotification
1717
|
18-
|@jsonNotification("notify")
18+
|@jsonRpcNotification("notify")
1919
|operation NotifySomething {
2020
|}
2121
|""".stripMargin
@@ -28,9 +28,9 @@ object JsonNotificationOutputValidatorSpec extends FunSuite {
2828
"""$version: "2"
2929
|namespace test
3030
|
31-
|use jsonrpclib#jsonNotification
31+
|use jsonrpclib#jsonRpcNotification
3232
|
33-
|@jsonNotification("notify")
33+
|@jsonRpcNotification("notify")
3434
|operation NotifySomething {
3535
| output:={
3636
| message: String
@@ -47,7 +47,7 @@ object JsonNotificationOutputValidatorSpec extends FunSuite {
4747
.shapeId(ShapeId.fromParts("test", "NotifySomething"))
4848
.severity(Severity.ERROR)
4949
.message(
50-
"Operation marked as @jsonNotification must not return anything, but found `test#NotifySomethingOutput`."
50+
"Operation marked as @jsonRpcNotification must not return anything, but found `test#NotifySomethingOutput`."
5151
)
5252
.build()
5353

modules/smithy-tests/src/test/scala/jsonrpclib/JsonPayloadValidatorSpec.scala

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,41 @@ import software.amazon.smithy.model.validation.ValidationEvent
88
import weaver._
99

1010
object JsonPayloadValidatorSpec extends FunSuite {
11-
test("no error when jsonPayload is used on the input, output or error structure's member") {
11+
test("no error when jsonRpcPayload is used on the input, output or error structure's member") {
1212

1313
assembleModel(
1414
"""$version: "2"
1515
|namespace test
1616
|
17-
|use jsonrpclib#jsonRPC
18-
|use jsonrpclib#jsonRequest
19-
|use jsonrpclib#jsonPayload
17+
|use jsonrpclib#jsonRpc
18+
|use jsonrpclib#jsonRpcRequest
19+
|use jsonrpclib#jsonRpcPayload
2020
|
21-
|@jsonRPC
21+
|@jsonRpc
2222
|service MyService {
2323
| operations: [OpA]
2424
|}
2525
|
26-
|@jsonRequest("foo")
26+
|@jsonRpcRequest("foo")
2727
|operation OpA {
2828
| input: OpInput
2929
| output: OpOutput
3030
| errors: [OpError]
3131
|}
3232
|
3333
|structure OpInput {
34-
| @jsonPayload
34+
| @jsonRpcPayload
3535
| data: String
3636
|}
3737
|
3838
|structure OpOutput {
39-
| @jsonPayload
39+
| @jsonRpcPayload
4040
| data: String
4141
|}
4242
|
4343
|@error("client")
4444
|structure OpError {
45-
| @jsonPayload
45+
| @jsonRpcPayload
4646
| data: String
4747
|}
4848
|
@@ -51,22 +51,22 @@ object JsonPayloadValidatorSpec extends FunSuite {
5151

5252
success
5353
}
54-
test("return an error when jsonPayload is used in a nested structure") {
54+
test("return an error when jsonRpcPayload is used in a nested structure") {
5555
val events = eventsWithoutLocations(
5656
assembleModel(
5757
"""$version: "2"
5858
|namespace test
5959
|
60-
|use jsonrpclib#jsonRPC
61-
|use jsonrpclib#jsonRequest
62-
|use jsonrpclib#jsonPayload
60+
|use jsonrpclib#jsonRpc
61+
|use jsonrpclib#jsonRpcRequest
62+
|use jsonrpclib#jsonRpcPayload
6363
|
64-
|@jsonRPC
64+
|@jsonRpc
6565
|service MyService {
6666
| operations: [OpA]
6767
|}
6868
|
69-
|@jsonRequest("foo")
69+
|@jsonRpcRequest("foo")
7070
|operation OpA {
7171
| input: OpInput
7272
|}
@@ -76,7 +76,7 @@ object JsonPayloadValidatorSpec extends FunSuite {
7676
|}
7777
|
7878
|structure NestedStructure {
79-
| @jsonPayload
79+
| @jsonRpcPayload
8080
| data: String
8181
|}
8282
|""".stripMargin
@@ -85,11 +85,11 @@ object JsonPayloadValidatorSpec extends FunSuite {
8585

8686
val expected = ValidationEvent
8787
.builder()
88-
.id("jsonPayload.OnlyTopLevel")
88+
.id("jsonRpcPayload.OnlyTopLevel")
8989
.shapeId(ShapeId.fromParts("test", "NestedStructure", "data"))
9090
.severity(Severity.ERROR)
9191
.message(
92-
"Found an incompatible shape when validating the constraints of the `jsonrpclib#jsonPayload` trait attached to `test#NestedStructure$data`: jsonPayload can only be used on the top level of an operation input/output/error."
92+
"Found an incompatible shape when validating the constraints of the `jsonrpclib#jsonRpcPayload` trait attached to `test#NestedStructure$data`: jsonRpcPayload can only be used on the top level of an operation input/output/error."
9393
)
9494
.build()
9595

modules/smithy-tests/src/test/scala/jsonrpclib/JsonRpcOperationValidatorSpec.scala

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ import software.amazon.smithy.model.validation.ValidationEvent
88
import weaver._
99

1010
object JsonRpcOperationValidatorSpec extends FunSuite {
11-
test("no error when all operations in @jsonRPC service are properly annotated") {
11+
test("no error when all operations in @jsonRpc service are properly annotated") {
1212
assembleModel(
1313
"""$version: "2"
1414
|namespace test
1515
|
16-
|use jsonrpclib#jsonRPC
17-
|use jsonrpclib#jsonRequest
18-
|use jsonrpclib#jsonNotification
16+
|use jsonrpclib#jsonRpc
17+
|use jsonrpclib#jsonRpcRequest
18+
|use jsonrpclib#jsonRpcNotification
1919
|
20-
|@jsonRPC
20+
|@jsonRpc
2121
|service MyService {
2222
| operations: [OpA, OpB]
2323
|}
2424
|
25-
|@jsonRequest("methodA")
25+
|@jsonRpcRequest("methodA")
2626
|operation OpA {}
2727
|
28-
|@jsonNotification("methodB")
28+
|@jsonRpcNotification("methodB")
2929
|operation OpB {
3030
| output: unit
3131
|}
@@ -34,24 +34,24 @@ object JsonRpcOperationValidatorSpec extends FunSuite {
3434
success
3535
}
3636

37-
test("return an error when a @jsonRPC service has an operation without @jsonRequest or @jsonNotification") {
37+
test("return an error when a @jsonRpc service has an operation without @jsonRpcRequest or @jsonRpcNotification") {
3838
val events = eventsWithoutLocations(
3939
assembleModel(
4040
"""$version: "2"
4141
|namespace test
4242
|
43-
|use jsonrpclib#jsonRPC
44-
|use jsonrpclib#jsonRequest
43+
|use jsonrpclib#jsonRpc
44+
|use jsonrpclib#jsonRpcRequest
4545
|
46-
|@jsonRPC
46+
|@jsonRpc
4747
|service MyService {
4848
| operations: [GoodOp, BadOp]
4949
|}
5050
|
51-
|@jsonRequest("good")
51+
|@jsonRpcRequest("good")
5252
|operation GoodOp {}
5353
|
54-
|operation BadOp {} // ❌ missing jsonRequest or jsonNotification
54+
|operation BadOp {} // ❌ missing jsonRpcRequest or jsonRpcNotification
5555
|""".stripMargin
5656
)
5757
)
@@ -63,7 +63,7 @@ object JsonRpcOperationValidatorSpec extends FunSuite {
6363
.shapeId(ShapeId.fromParts("test", "BadOp"))
6464
.severity(Severity.ERROR)
6565
.message(
66-
"Operation is part of service `test#MyService` marked with @jsonRPC but is missing @jsonRequest or @jsonNotification."
66+
"Operation is part of service `test#MyService` marked with @jsonRpc but is missing @jsonRpcRequest or @jsonRpcNotification."
6767
)
6868
.build()
6969

modules/smithy-tests/src/test/scala/jsonrpclib/UniqueJsonRpcMethodNamesValidatorSpec.scala

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ object UniqueJsonRpcMethodNamesValidatorSpec extends FunSuite {
1414
"""$version: "2"
1515
|namespace test
1616
|
17-
|use jsonrpclib#jsonRPC
18-
|use jsonrpclib#jsonRequest
19-
|use jsonrpclib#jsonNotification
17+
|use jsonrpclib#jsonRpc
18+
|use jsonrpclib#jsonRpcRequest
19+
|use jsonrpclib#jsonRpcNotification
2020
|
21-
|@jsonRPC
21+
|@jsonRpc
2222
|service MyService {
2323
| operations: [OpA, OpB]
2424
|}
2525
|
26-
|@jsonRequest("foo")
26+
|@jsonRpcRequest("foo")
2727
|operation OpA {}
2828
|
29-
|@jsonNotification("bar")
29+
|@jsonRpcNotification("bar")
3030
|operation OpB {}
3131
|""".stripMargin
3232
).unwrap()
@@ -39,19 +39,19 @@ object UniqueJsonRpcMethodNamesValidatorSpec extends FunSuite {
3939
"""$version: "2"
4040
|namespace test
4141
|
42-
|use jsonrpclib#jsonRPC
43-
|use jsonrpclib#jsonRequest
44-
|use jsonrpclib#jsonNotification
42+
|use jsonrpclib#jsonRpc
43+
|use jsonrpclib#jsonRpcRequest
44+
|use jsonrpclib#jsonRpcNotification
4545
|
46-
|@jsonRPC
46+
|@jsonRpc
4747
|service MyService {
4848
| operations: [OpA, OpB]
4949
|}
5050
|
51-
|@jsonRequest("foo")
51+
|@jsonRpcRequest("foo")
5252
|operation OpA {}
5353
|
54-
|@jsonNotification("foo")
54+
|@jsonRpcNotification("foo")
5555
|operation OpB {} // duplicate method name "foo"
5656
|""".stripMargin
5757
)
@@ -75,21 +75,21 @@ object UniqueJsonRpcMethodNamesValidatorSpec extends FunSuite {
7575
"""$version: "2"
7676
|namespace test
7777
|
78-
|use jsonrpclib#jsonRPC
79-
|use jsonrpclib#jsonRequest
80-
|use jsonrpclib#jsonNotification
78+
|use jsonrpclib#jsonRpc
79+
|use jsonrpclib#jsonRpcRequest
80+
|use jsonrpclib#jsonRpcNotification
8181
|
82-
|@jsonRPC
82+
|@jsonRpc
8383
|service MyService {
8484
| operations: [OpA]
8585
|}
8686
|
87-
|@jsonRPC
87+
|@jsonRpc
8888
|service MyOtherService {
8989
| operations: [OpA]
9090
|}
9191
|
92-
|@jsonRequest("foo")
92+
|@jsonRpcRequest("foo")
9393
|operation OpA {}
9494
|
9595
|""".stripMargin
@@ -102,18 +102,18 @@ object UniqueJsonRpcMethodNamesValidatorSpec extends FunSuite {
102102
"""$version: "2"
103103
|namespace test
104104
|
105-
|use jsonrpclib#jsonRequest
106-
|use jsonrpclib#jsonNotification
105+
|use jsonrpclib#jsonRpcRequest
106+
|use jsonrpclib#jsonRpcNotification
107107
|
108108
|
109109
|service NonJsonRpcService {
110110
| operations: [OpA]
111111
|}
112112
|
113-
|@jsonRequest("foo")
113+
|@jsonRpcRequest("foo")
114114
|operation OpA {}
115115
|
116-
|@jsonNotification("foo")
116+
|@jsonRpcNotification("foo")
117117
|operation OpB {} // duplicate method name "foo"
118118
|""".stripMargin
119119
).unwrap()

modules/smithy/src/main/java/jsonrpclib/validation/JsonNotificationOutputValidator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public List<ValidationEvent> validate(Model model) {
2323
var outputShape = model.expectShape(outputShapeId);
2424
if (outputShape.asStructureShape().map(s -> !s.members().isEmpty()).orElse(true)) {
2525
return Stream.of(error(op, String.format(
26-
"Operation marked as @jsonNotification must not return anything, but found `%s`.", outputShapeId)));
26+
"Operation marked as @jsonRpcNotification must not return anything, but found `%s`.", outputShapeId)));
2727
} else {
2828
return Stream.empty();
2929
}

modules/smithy/src/main/java/jsonrpclib/validation/JsonRpcOperationValidator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ private Stream<ValidationEvent> validateService(Model model, ServiceShape servic
2828
.map(model::expectShape)
2929
.filter(op -> !hasJsonRpcMethod(op))
3030
.map(op -> error(op, String.format(
31-
"Operation is part of service `%s` marked with @jsonRPC but is missing @jsonRequest or @jsonNotification.", service.getId())));
31+
"Operation is part of service `%s` marked with @jsonRpc but is missing @jsonRpcRequest or @jsonRpcNotification.", service.getId())));
3232
}
3333

3434
private boolean hasJsonRpcMethod(Shape op) {

0 commit comments

Comments
 (0)