Skip to content

Commit 31ac3f1

Browse files
committed
refactor: project-wide change of OAS vendor extensions cactus -> cacti
1. Did a complete find & replace of the old vendor extensions and the new ones. In theory this is a change that the compiler guarantees for us to verify completely, but even with that said, I'll leave the CI on so that we can double check to be sure. This is also a BREAKING CHANGE because if someone had installed the older packages and they imported endpoint definitions from the OAS spec based on the vendor extensions then their could would stop compiling. Therefore this change must be done before we issue the 2.0.0 release. 2. Also added a bug-fix to tools/custom-checks/check-open-api-json-specs.ts because it wasn't just validating HTTP verbs within "paths" but also any property that was in there such as "summary" or "description" but of course those are string properties so they won't pass the validation we impose on HTTP verb definitions for the endpoints. Fixes #2872 Signed-off-by: Peter Somogyvari <[email protected]>
1 parent bf9dfe8 commit 31ac3f1

File tree

149 files changed

+447
-417
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+447
-417
lines changed

examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/json/openapi.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
"post": {
156156
"operationId": "enrollAdminV1",
157157
"summary": "Registers an admin account within the Fabric organization specified.",
158-
"x-hyperledger-cactus": {
158+
"x-hyperledger-cacti": {
159159
"authz": {
160160
"isProtected": true,
161161
"requiredRoles": ["group:admin"]
@@ -192,7 +192,7 @@
192192
"post": {
193193
"operationId": "daoTokenGetAllowanceV1",
194194
"summary": "Get the number of tokens `spender` is approved to spend on behalf of `account`",
195-
"x-hyperledger-cactus": {
195+
"x-hyperledger-cacti": {
196196
"http": {
197197
"verbLowerCase": "post",
198198
"path": "/api/v1/plugins/@hyperledger/cactus-example-carbon-accounting-backend/dao-token/get-allowance"

examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/typescript/business-logic-plugin/web-services/dao-token/get-allowance-endpoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ export class GetAllowanceEndpoint implements IWebServiceEndpoint {
6363
}
6464

6565
public getVerbLowerCase(): string {
66-
return this.oasPath.post["x-hyperledger-cactus"].http.verbLowerCase;
66+
return this.oasPath.post["x-hyperledger-cacti"].http.verbLowerCase;
6767
}
6868

6969
public getPath(): string {
70-
return this.oasPath.post["x-hyperledger-cactus"].http.path;
70+
return this.oasPath.post["x-hyperledger-cacti"].http.path;
7171
}
7272

7373
public getExpressRequestHandler(): IExpressRequestHandler {

examples/cactus-example-carbon-accounting-business-logic-plugin/src/main/typescript/business-logic-plugin/web-services/utility-emissions-channel/enroll-admin-v1-endpoint.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class EnrollAdminV1Endpoint implements IWebServiceEndpoint {
4848

4949
getAuthorizationOptionsProvider(): IAsyncProvider<IEndpointAuthzOptions> {
5050
return {
51-
get: async () => this.oasPath.post["x-hyperledger-cactus"].authz,
51+
get: async () => this.oasPath.post["x-hyperledger-cacti"].authz,
5252
};
5353
}
5454

@@ -57,11 +57,11 @@ export class EnrollAdminV1Endpoint implements IWebServiceEndpoint {
5757
}
5858

5959
public getVerbLowerCase(): string {
60-
return this.oasPath.post["x-hyperledger-cactus"].http.verbLowerCase;
60+
return this.oasPath.post["x-hyperledger-cacti"].http.verbLowerCase;
6161
}
6262

6363
public getPath(): string {
64-
return this.oasPath.post["x-hyperledger-cactus"].http.path;
64+
return this.oasPath.post["x-hyperledger-cacti"].http.path;
6565
}
6666

6767
public getExpressRequestHandler(): IExpressRequestHandler {

examples/cactus-example-supply-chain-business-logic-plugin/src/main/json/openapi.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@
215215
"/api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/insert-bookshelf": {
216216
"post": {
217217
"operationId": "insertBookshelfV1",
218-
"x-hyperledger-cactus": {
218+
"x-hyperledger-cacti": {
219219
"http": {
220220
"verbLowerCase": "post",
221221
"path": "/api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/insert-bookshelf"
@@ -249,7 +249,7 @@
249249
"/api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/list-bookshelf": {
250250
"get": {
251251
"operationId": "listBookshelfV1",
252-
"x-hyperledger-cactus": {
252+
"x-hyperledger-cacti": {
253253
"http": {
254254
"verbLowerCase": "get",
255255
"path": "/api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/list-bookshelf"
@@ -273,7 +273,7 @@
273273
},
274274
"/api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/insert-shipment": {
275275
"post": {
276-
"x-hyperledger-cactus": {
276+
"x-hyperledger-cacti": {
277277
"http": {
278278
"verbLowerCase": "post",
279279
"path": "/api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/insert-shipment"
@@ -307,7 +307,7 @@
307307
},
308308
"/api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/list-shipment": {
309309
"get": {
310-
"x-hyperledger-cactus": {
310+
"x-hyperledger-cacti": {
311311
"http": {
312312
"verbLowerCase": "get",
313313
"path": "/api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/list-shipment"
@@ -333,7 +333,7 @@
333333
"/api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/insert-bamboo-harvest": {
334334
"post": {
335335
"operationId": "insertBambooHarvestV1",
336-
"x-hyperledger-cactus": {
336+
"x-hyperledger-cacti": {
337337
"http": {
338338
"verbLowerCase": "post",
339339
"path": "/api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/insert-bamboo-harvest"
@@ -367,7 +367,7 @@
367367
"/api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/list-bamboo-harvest": {
368368
"get": {
369369
"operationId": "listBambooHarvestV1",
370-
"x-hyperledger-cactus": {
370+
"x-hyperledger-cacti": {
371371
"http": {
372372
"verbLowerCase": "get",
373373
"path": "/api/v1/plugins/@hyperledger/cactus-example-supply-chain-backend/list-bamboo-harvest"

examples/cactus-example-supply-chain-business-logic-plugin/src/main/typescript/business-logic-plugin/web-services/insert-bamboo-harvest-endpoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ export class InsertBambooHarvestEndpoint implements IWebServiceEndpoint {
9494

9595
public getVerbLowerCase(): string {
9696
const apiPath = this.getOasPath();
97-
return apiPath.post["x-hyperledger-cactus"].http.verbLowerCase;
97+
return apiPath.post["x-hyperledger-cacti"].http.verbLowerCase;
9898
}
9999

100100
public getPath(): string {
101101
const apiPath = this.getOasPath();
102-
return apiPath.post["x-hyperledger-cactus"].http.path;
102+
return apiPath.post["x-hyperledger-cacti"].http.path;
103103
}
104104

105105
public getExpressRequestHandler(): IExpressRequestHandler {

examples/cactus-example-supply-chain-business-logic-plugin/src/main/typescript/business-logic-plugin/web-services/insert-bookshelf-endpoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ export class InsertBookshelfEndpoint implements IWebServiceEndpoint {
8282

8383
public getVerbLowerCase(): string {
8484
const apiPath = this.getOasPath();
85-
return apiPath.post["x-hyperledger-cactus"].http.verbLowerCase;
85+
return apiPath.post["x-hyperledger-cacti"].http.verbLowerCase;
8686
}
8787

8888
public getPath(): string {
8989
const apiPath = this.getOasPath();
90-
return apiPath.post["x-hyperledger-cactus"].http.path;
90+
return apiPath.post["x-hyperledger-cacti"].http.path;
9191
}
9292

9393
public getExpressRequestHandler(): IExpressRequestHandler {

examples/cactus-example-supply-chain-business-logic-plugin/src/main/typescript/business-logic-plugin/web-services/insert-shipment-endpoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ export class InsertShipmentEndpoint implements IWebServiceEndpoint {
7575

7676
getPath(): string {
7777
const apiPath = this.getOasPath();
78-
return apiPath.post["x-hyperledger-cactus"].http.path;
78+
return apiPath.post["x-hyperledger-cacti"].http.path;
7979
}
8080

8181
getVerbLowerCase(): string {
8282
const apiPath = this.getOasPath();
83-
return apiPath.post["x-hyperledger-cactus"].http.verbLowerCase;
83+
return apiPath.post["x-hyperledger-cacti"].http.verbLowerCase;
8484
}
8585

8686
public getOperationId(): string {

examples/cactus-example-supply-chain-business-logic-plugin/src/main/typescript/business-logic-plugin/web-services/list-bamboo-harvest-endpoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ export class ListBambooHarvestEndpoint implements IWebServiceEndpoint {
8181

8282
public getVerbLowerCase(): string {
8383
const apiPath = this.getOasPath();
84-
return apiPath.get["x-hyperledger-cactus"].http.verbLowerCase;
84+
return apiPath.get["x-hyperledger-cacti"].http.verbLowerCase;
8585
}
8686

8787
public getPath(): string {
8888
const apiPath = this.getOasPath();
89-
return apiPath.get["x-hyperledger-cactus"].http.path;
89+
return apiPath.get["x-hyperledger-cacti"].http.path;
9090
}
9191

9292
public getExpressRequestHandler(): IExpressRequestHandler {

examples/cactus-example-supply-chain-business-logic-plugin/src/main/typescript/business-logic-plugin/web-services/list-bookshelf-endpoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ export class ListBookshelfEndpoint implements IWebServiceEndpoint {
7979

8080
public getVerbLowerCase(): string {
8181
const apiPath = this.getOasPath();
82-
return apiPath.get["x-hyperledger-cactus"].http.verbLowerCase;
82+
return apiPath.get["x-hyperledger-cacti"].http.verbLowerCase;
8383
}
8484

8585
public getPath(): string {
8686
const apiPath = this.getOasPath();
87-
return apiPath.get["x-hyperledger-cactus"].http.path;
87+
return apiPath.get["x-hyperledger-cacti"].http.path;
8888
}
8989

9090
public getExpressRequestHandler(): IExpressRequestHandler {

examples/cactus-example-supply-chain-business-logic-plugin/src/main/typescript/business-logic-plugin/web-services/list-shipment-endpoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ export class ListShipmentEndpoint implements IWebServiceEndpoint {
4646

4747
getPath(): string {
4848
const apiPath = this.getOasPath();
49-
return apiPath.get["x-hyperledger-cactus"].http.path;
49+
return apiPath.get["x-hyperledger-cacti"].http.path;
5050
}
5151

5252
getVerbLowerCase(): string {
5353
const apiPath = this.getOasPath();
54-
return apiPath.get["x-hyperledger-cactus"].http.verbLowerCase;
54+
return apiPath.get["x-hyperledger-cacti"].http.verbLowerCase;
5555
}
5656

5757
public getOperationId(): string {

extensions/cactus-plugin-htlc-coordinator-besu/src/main/json/openapi.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@
213213
"paths": {
214214
"/api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/own-htlc": {
215215
"post": {
216-
"x-hyperledger-cactus": {
216+
"x-hyperledger-cacti": {
217217
"http": {
218218
"verbLowerCase": "post",
219219
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/own-htlc"
@@ -245,7 +245,7 @@
245245
},
246246
"/api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/counterparty-htlc": {
247247
"post": {
248-
"x-hyperledger-cactus": {
248+
"x-hyperledger-cacti": {
249249
"http": {
250250
"verbLowerCase": "post",
251251
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/counterparty-htlc"
@@ -277,7 +277,7 @@
277277
},
278278
"/api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/withdraw-counterparty": {
279279
"post": {
280-
"x-hyperledger-cactus": {
280+
"x-hyperledger-cacti": {
281281
"http": {
282282
"verbLowerCase": "post",
283283
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-htlc-coordinator-besu/withdraw-counterparty"

extensions/cactus-plugin-htlc-coordinator-besu/src/main/typescript/web-services/counterparty-htlc-endpoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ export class CounterpartyHTLCEndpoint implements IWebServiceEndpoint {
5555

5656
public getPath(): string {
5757
const apiPath = this.getOasPath();
58-
return apiPath.post["x-hyperledger-cactus"].http.path;
58+
return apiPath.post["x-hyperledger-cacti"].http.path;
5959
}
6060

6161
public getVerbLowerCase(): string {
6262
const apiPath = this.getOasPath();
63-
return apiPath.post["x-hyperledger-cactus"].http.verbLowerCase;
63+
return apiPath.post["x-hyperledger-cacti"].http.verbLowerCase;
6464
}
6565

6666
public getOperationId(): string {

extensions/cactus-plugin-htlc-coordinator-besu/src/main/typescript/web-services/own-htlc-endpoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ export class OwnHTLCEndpoint implements IWebServiceEndpoint {
5555

5656
public getPath(): string {
5757
const apiPath = this.getOasPath();
58-
return apiPath.post["x-hyperledger-cactus"].http.path;
58+
return apiPath.post["x-hyperledger-cacti"].http.path;
5959
}
6060

6161
public getVerbLowerCase(): string {
6262
const apiPath = this.getOasPath();
63-
return apiPath.post["x-hyperledger-cactus"].http.verbLowerCase;
63+
return apiPath.post["x-hyperledger-cacti"].http.verbLowerCase;
6464
}
6565

6666
public getOperationId(): string {

extensions/cactus-plugin-htlc-coordinator-besu/src/main/typescript/web-services/withdraw-counterparty-endpoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ export class WithdrawCounterpartyEndpoint implements IWebServiceEndpoint {
5757

5858
public getPath(): string {
5959
const apiPath = this.getOasPath();
60-
return apiPath.post["x-hyperledger-cactus"].http.path;
60+
return apiPath.post["x-hyperledger-cacti"].http.path;
6161
}
6262

6363
public getVerbLowerCase(): string {
6464
const apiPath = this.getOasPath();
65-
return apiPath.post["x-hyperledger-cactus"].http.verbLowerCase;
65+
return apiPath.post["x-hyperledger-cacti"].http.verbLowerCase;
6666
}
6767

6868
public getOperationId(): string {

extensions/cactus-plugin-object-store-ipfs/src/main/json/openapi.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"paths": {
3838
"/api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/get-object": {
3939
"post": {
40-
"x-hyperledger-cactus": {
40+
"x-hyperledger-cacti": {
4141
"http": {
4242
"verbLowerCase": "post",
4343
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/get-object"
@@ -58,7 +58,7 @@
5858
},
5959
"/api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/set-object": {
6060
"post": {
61-
"x-hyperledger-cactus": {
61+
"x-hyperledger-cacti": {
6262
"http": {
6363
"verbLowerCase": "post",
6464
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/set-object"
@@ -79,7 +79,7 @@
7979
},
8080
"/api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/has-object": {
8181
"post": {
82-
"x-hyperledger-cactus": {
82+
"x-hyperledger-cacti": {
8383
"http": {
8484
"verbLowerCase": "post",
8585
"path": "/api/v1/plugins/@hyperledger/cactus-plugin-object-store-ipfs/has-object"

extensions/cactus-plugin-object-store-ipfs/src/main/typescript/web-services/get-object-endpoint-v1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ export class GetObjectEndpointV1 implements IWebServiceEndpoint {
7272
}
7373

7474
public getVerbLowerCase(): string {
75-
return this.getOperation()["x-hyperledger-cactus"].http.verbLowerCase;
75+
return this.getOperation()["x-hyperledger-cacti"].http.verbLowerCase;
7676
}
7777

7878
public getPath(): string {
79-
return this.getOperation()["x-hyperledger-cactus"].http.path;
79+
return this.getOperation()["x-hyperledger-cacti"].http.path;
8080
}
8181

8282
public getExpressRequestHandler(): IExpressRequestHandler {

extensions/cactus-plugin-object-store-ipfs/src/main/typescript/web-services/has-object-endpoint-v1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ export class HasObjectEndpointV1 implements IWebServiceEndpoint {
7272
}
7373

7474
public getVerbLowerCase(): string {
75-
return this.getOperation()["x-hyperledger-cactus"].http.verbLowerCase;
75+
return this.getOperation()["x-hyperledger-cacti"].http.verbLowerCase;
7676
}
7777

7878
public getPath(): string {
79-
return this.getOperation()["x-hyperledger-cactus"].http.path;
79+
return this.getOperation()["x-hyperledger-cacti"].http.path;
8080
}
8181

8282
public getExpressRequestHandler(): IExpressRequestHandler {

extensions/cactus-plugin-object-store-ipfs/src/main/typescript/web-services/set-object-endpoint-v1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ export class SetObjectEndpointV1 implements IWebServiceEndpoint {
7272
}
7373

7474
public getVerbLowerCase(): string {
75-
return this.getOperation()["x-hyperledger-cactus"].http.verbLowerCase;
75+
return this.getOperation()["x-hyperledger-cacti"].http.verbLowerCase;
7676
}
7777

7878
public getPath(): string {
79-
return this.getOperation()["x-hyperledger-cactus"].http.path;
79+
return this.getOperation()["x-hyperledger-cacti"].http.path;
8080
}
8181

8282
public getExpressRequestHandler(): IExpressRequestHandler {

packages/cactus-cmd-api-server/src/main/json/openapi.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"get": {
8484
"summary": "Can be used to verify liveness of an API server instance",
8585
"description": "Returns the current timestamp of the API server as proof of health/liveness",
86-
"x-hyperledger-cactus": {
86+
"x-hyperledger-cacti": {
8787
"http": {
8888
"verbLowerCase": "get",
8989
"path": "/api/v1/api-server/healthcheck"
@@ -107,7 +107,7 @@
107107
},
108108
"/api/v1/api-server/get-prometheus-exporter-metrics": {
109109
"get": {
110-
"x-hyperledger-cactus": {
110+
"x-hyperledger-cacti": {
111111
"http": {
112112
"verbLowerCase": "get",
113113
"path": "/api/v1/api-server/get-prometheus-exporter-metrics"
@@ -133,7 +133,7 @@
133133
"/api/v1/api-server/get-open-api-spec": {
134134
"get": {
135135
"description": "Returns the openapi.json document of specific plugin.",
136-
"x-hyperledger-cactus": {
136+
"x-hyperledger-cacti": {
137137
"http": {
138138
"verbLowerCase": "get",
139139
"path": "/api/v1/api-server/get-open-api-spec"

packages/cactus-cmd-api-server/src/main/typescript/api-server.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -577,9 +577,9 @@ export class ApiServer {
577577
oas: OAS,
578578
oasPath,
579579
operationId,
580-
path: oasPath.get["x-hyperledger-cactus"].http.path,
580+
path: oasPath.get["x-hyperledger-cacti"].http.path,
581581
pluginRegistry,
582-
verbLowerCase: oasPath.get["x-hyperledger-cactus"].http.verbLowerCase,
582+
verbLowerCase: oasPath.get["x-hyperledger-cacti"].http.verbLowerCase,
583583
logLevel,
584584
};
585585
const endpoint = new GetOpenApiSpecV1Endpoint(opts);
@@ -595,7 +595,7 @@ export class ApiServer {
595595
};
596596

597597
const { "/api/v1/api-server/healthcheck": oasPath } = OAS.paths;
598-
const { http } = oasPath.get["x-hyperledger-cactus"];
598+
const { http } = oasPath.get["x-hyperledger-cacti"];
599599
const { path: httpPath, verbLowerCase: httpVerb } = http;
600600
if (!isExpressHttpVerbMethodName(httpVerb)) {
601601
const eMsg = `${fnTag} Invalid HTTP verb "${httpVerb}" in cmd-api-server OpenAPI specification for HTTP path: "${httpPath}"`;
@@ -634,7 +634,7 @@ export class ApiServer {
634634
} = OAS.paths;
635635

636636
const { http: httpPrometheus } =
637-
oasPathPrometheus.get["x-hyperledger-cactus"];
637+
oasPathPrometheus.get["x-hyperledger-cacti"];
638638

639639
const { path: httpPathPrometheus, verbLowerCase: httpVerbPrometheus } =
640640
httpPrometheus;

0 commit comments

Comments
 (0)