Skip to content

Commit 4cb5571

Browse files
committed
Fix RPC v2 URI resolution
This commit removes the possiblity to customize the HTTP URI for the Smithy RPC v2 CBOR protocol by setting a non-`/` value in the `http` property. It also fixes some typos in the contributing document.
1 parent beaa6ef commit 4cb5571

File tree

4 files changed

+13
-64
lines changed

4 files changed

+13
-64
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "bugfix",
3+
"category": "AWS SDK for Java v2",
4+
"contributor": "kstich",
5+
"description": "Fix Smithy RPC v2 CBOR URI resolution allowing custom URIs."
6+
}

CONTRIBUTING.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ __Jump To:__
1111
* [Additional Resources](#additional-resources)
1212

1313
## Bug Reports
14-
Bug reports are accepted through the [this][bug-report] page.
14+
Bug reports are accepted through [this][bug-report] page.
1515

1616
The following labels are used to track bug related issues: [Bug][label-bug],
1717
[Documentation Issue][label-doc-issue].
@@ -38,7 +38,7 @@ please ensure that your bug report has the following:
3838

3939
* A short, descriptive title. Ideally, other community members should be able
4040
to get a good idea of the issue just from reading the title.
41-
* A succint, detailed description of the problem you're experiencing. This
41+
* A succinct, detailed description of the problem you're experiencing. This
4242
should include:
4343
* Expected behavior of the SDK and the actual behavior exhibited.
4444
* Any details of your application environment that may be relevant. At
@@ -51,7 +51,7 @@ please ensure that your bug report has the following:
5151
stacktraces.
5252

5353
## Feature Requests
54-
Feature requests are submitted through the [this][feature-request] page.
54+
Feature requests are submitted through [this][feature-request] page.
5555

5656
As with Bug Reports, please do a search of the open requests first before
5757
submitting a new one to avoid duplicates. If you find an existing one, give it
@@ -71,7 +71,7 @@ Open an [issue][issues] with the following:
7171

7272
* A short, descriptive title. Ideally, other community members should be able
7373
to get a good idea of the feature just from reading the title.
74-
* A detailed description of the the proposed feature. Include justification for
74+
* A detailed description of the proposed feature. Include justification for
7575
why it should be added to the SDK, and possibly example code to illustrate
7676
how it should work.
7777
* [Markdown][markdown] formatting as appropriate to make the request easier to
@@ -136,11 +136,11 @@ interfaces](https://github.com/reactive-streams/reactive-streams-jvm), the
136136
change must also contain verification tests using the [Reactive Streams
137137
Technology Compatibility
138138
Kit](https://github.com/reactive-streams/reactive-streams-jvm/tree/master/tck)
139-
to ensure specificiation compliance.
139+
to ensure specification compliance.
140140

141141
### Getting Your Pull Request Merged
142142
All Pull Requests must be approved by at least one member of the SDK team
143-
before it can be merged in. The members only have limited bandwitdth to review
143+
before it can be merged in. The members only have limited bandwidth to review
144144
Pull Requests so it's not unusual for a Pull Request to go unreviewed for a few
145145
days, especially if it's a large or complex one. If, after a week, your Pull
146146
Request has not had any engagement from the SDK team, feel free to ping a

codegen/src/main/java/software/amazon/awssdk/codegen/customization/processors/SmithyRpcV2CborProtocolProcessor.java

-5
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ public void preprocess(ServiceModel serviceModel) {
3838
}
3939

4040
private void setRequestUri(ServiceModel service, String name, Operation op) {
41-
Http http = op.getHttp();
42-
String requestUri = http.getRequestUri();
43-
if (StringUtils.isNotBlank(requestUri) && !"/".equals(requestUri)) {
44-
return;
45-
}
4641
String uri = String.format("/service/%s/operation/%s", service.getMetadata().getTargetPrefix(), op.getName());
4742
op.getHttp().setRequestUri(uri);
4843
}

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/c2j/rpcv2/service-2.json

+1-53
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,19 @@
1616
"operations":{
1717
"EmptyInputOutput":{
1818
"name":"EmptyInputOutput",
19-
"http":{
20-
"method":"POST",
21-
"requestUri":"/"
22-
},
2319
"input":{"shape":"EmptyStructure"},
2420
"output":{"shape":"EmptyStructure"}
2521
},
2622
"Float16":{
2723
"name":"Float16",
28-
"http":{
29-
"method":"POST",
30-
"requestUri":"/"
31-
},
3224
"output":{"shape":"Float16Output"}
3325
},
3426
"FractionalSeconds":{
3527
"name":"FractionalSeconds",
36-
"http":{
37-
"method":"POST",
38-
"requestUri":"/"
39-
},
4028
"output":{"shape":"FractionalSecondsOutput"}
4129
},
4230
"GreetingWithErrors":{
4331
"name":"GreetingWithErrors",
44-
"http":{
45-
"method":"POST",
46-
"requestUri":"/"
47-
},
4832
"output":{"shape":"GreetingWithErrorsOutput"},
4933
"errors":[
5034
{"shape":"ComplexError"},
@@ -53,18 +37,10 @@
5337
"idempotent":true
5438
},
5539
"NoInputOutput":{
56-
"name":"NoInputOutput",
57-
"http":{
58-
"method":"POST",
59-
"requestUri":"/"
60-
}
40+
"name":"NoInputOutput"
6141
},
6242
"OperationWithDefaults":{
6343
"name":"OperationWithDefaults",
64-
"http":{
65-
"method":"POST",
66-
"requestUri":"/"
67-
},
6844
"input":{"shape":"OperationWithDefaultsInput"},
6945
"output":{"shape":"OperationWithDefaultsOutput"},
7046
"errors":[
@@ -73,28 +49,16 @@
7349
},
7450
"OptionalInputOutput":{
7551
"name":"OptionalInputOutput",
76-
"http":{
77-
"method":"POST",
78-
"requestUri":"/"
79-
},
8052
"input":{"shape":"SimpleStructure"},
8153
"output":{"shape":"SimpleStructure"}
8254
},
8355
"RecursiveShapes":{
8456
"name":"RecursiveShapes",
85-
"http":{
86-
"method":"POST",
87-
"requestUri":"/"
88-
},
8957
"input":{"shape":"RecursiveShapesInputOutput"},
9058
"output":{"shape":"RecursiveShapesInputOutput"}
9159
},
9260
"RpcV2CborDenseMaps":{
9361
"name":"RpcV2CborDenseMaps",
94-
"http":{
95-
"method":"POST",
96-
"requestUri":"/"
97-
},
9862
"input":{"shape":"RpcV2CborDenseMapsInputOutput"},
9963
"output":{"shape":"RpcV2CborDenseMapsInputOutput"},
10064
"errors":[
@@ -103,10 +67,6 @@
10367
},
10468
"RpcV2CborLists":{
10569
"name":"RpcV2CborLists",
106-
"http":{
107-
"method":"POST",
108-
"requestUri":"/"
109-
},
11070
"input":{"shape":"RpcV2CborListInputOutput"},
11171
"output":{"shape":"RpcV2CborListInputOutput"},
11272
"errors":[
@@ -116,10 +76,6 @@
11676
},
11777
"RpcV2CborSparseMaps":{
11878
"name":"RpcV2CborSparseMaps",
119-
"http":{
120-
"method":"POST",
121-
"requestUri":"/"
122-
},
12379
"input":{"shape":"RpcV2CborSparseMapsInputOutput"},
12480
"output":{"shape":"RpcV2CborSparseMapsInputOutput"},
12581
"errors":[
@@ -128,19 +84,11 @@
12884
},
12985
"SimpleScalarProperties":{
13086
"name":"SimpleScalarProperties",
131-
"http":{
132-
"method":"POST",
133-
"requestUri":"/"
134-
},
13587
"input":{"shape":"SimpleScalarStructure"},
13688
"output":{"shape":"SimpleScalarStructure"}
13789
},
13890
"SparseNullsOperation":{
13991
"name":"SparseNullsOperation",
140-
"http":{
141-
"method":"POST",
142-
"requestUri":"/"
143-
},
14492
"input":{"shape":"SparseNullsOperationInputOutput"},
14593
"output":{"shape":"SparseNullsOperationInputOutput"}
14694
}

0 commit comments

Comments
 (0)