Skip to content

Commit 2412073

Browse files
authored
Merge pull request #72 from advanced-rest-client/fix/W-18830464-fix-special-chars-1
W-18830464 API specifications and examples
2 parents 3d43ae8 + 1c1bae4 commit 2412073

File tree

13 files changed

+457
-24
lines changed

13 files changed

+457
-24
lines changed

.github/workflows/deployment.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
os: [ubuntu-20.04]
20+
os: [ubuntu-22.04]
2121
runs-on: ${{ matrix.os }}
2222
steps:
2323
- uses: actions/checkout@v2
2424
- uses: actions/setup-node@v1
2525
with:
26-
node-version: 16
26+
node-version: 18
2727
- uses: microsoft/playwright-github-action@v1
2828
- uses: actions/cache@v3
2929
with:
@@ -42,7 +42,7 @@ jobs:
4242
- uses: actions/checkout@v2
4343
- uses: actions/setup-node@v1
4444
with:
45-
node-version: 16
45+
node-version: 18
4646
- uses: microsoft/playwright-github-action@v1
4747
- uses: actions/cache@v3
4848
with:
@@ -68,7 +68,7 @@ jobs:
6868
fetch-depth: 0
6969
- uses: actions/setup-node@v2
7070
with:
71-
node-version: '16.x'
71+
node-version: '18.x'
7272
registry-url: 'https://registry.npmjs.org'
7373
- uses: actions/cache@v3
7474
with:

demo/W-18830464/W-18830464.json

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
{
2+
"openapi": "3.0.0",
3+
"info": {
4+
"version": "1.0.0",
5+
"title": "test-otr-eapi"
6+
},
7+
"components": {
8+
"securitySchemes": {
9+
"basicAuth": {
10+
"type": "http",
11+
"scheme": "basic"
12+
}
13+
}
14+
},
15+
"security": [
16+
{
17+
"basicAuth": []
18+
}
19+
],
20+
"paths": {
21+
"/asset": {
22+
"post": {
23+
"description": "Create a span",
24+
"parameters": [
25+
{
26+
"$ref": "common/common-header.json#components/parameters/SourceHeader"
27+
},
28+
{
29+
"$ref": "common/common-header.json#components/parameters/TargetHeader"
30+
},
31+
{
32+
"$ref": "common/common-header.json#components/parameters/correlationId"
33+
}
34+
],
35+
"requestBody": {
36+
"required": true,
37+
"content": {
38+
"application/json": {
39+
"schema": {
40+
"$ref": "schema/request/test-otr-eapi-request-schema.json#/components/schemas/createAsset"
41+
},
42+
"examples": {
43+
"createAsset": {
44+
"$ref": "examples/request/test-otr-eapi-request.json#/components/examples/createAsset"
45+
}
46+
}
47+
}
48+
}
49+
},
50+
"responses": {
51+
"200": {
52+
"description": "Span created",
53+
"content": {
54+
"application/json": {
55+
"schema": {
56+
"$ref": "schema/response/test-otr-eapi-response-schema.json#/components/schemas/createAsset"
57+
},
58+
"examples": {
59+
"createAsset": {
60+
"$ref": "examples/response/test-otr-eapi-response.json#/components/examples/createAsset"
61+
}
62+
}
63+
}
64+
}
65+
}
66+
}
67+
}
68+
},
69+
"/preferences": {
70+
"post": {
71+
"description": "Create a preferences",
72+
"parameters": [
73+
{
74+
"$ref": "common/common-header.json#components/parameters/SourceHeader"
75+
},
76+
{
77+
"$ref": "common/common-header.json#components/parameters/TargetHeader"
78+
},
79+
{
80+
"$ref": "common/common-header.json#components/parameters/correlationId"
81+
}
82+
],
83+
"requestBody": {
84+
"required": true,
85+
"content": {
86+
"application/json": {
87+
"schema": {
88+
"$ref": "schema/request/test-otr-eapi-request-schema.json#/components/schemas/createPreferences"
89+
},
90+
"examples": {
91+
"createPreferences": {
92+
"$ref": "examples/request/test-otr-eapi-request.json#/components/examples/createPreferences"
93+
}
94+
}
95+
}
96+
}
97+
},
98+
"responses": {
99+
"200": {
100+
"description": "Preferences created",
101+
"content": {
102+
"application/json": {
103+
"schema": {
104+
"$ref": "schema/response/test-otr-eapi-response-schema.json#/components/schemas/createPreferences"
105+
},
106+
"examples": {
107+
"CreateSpanRes": {
108+
"$ref": "examples/response/test-otr-eapi-response.json#/components/examples/createPreferences"
109+
}
110+
}
111+
}
112+
}
113+
}
114+
}
115+
}
116+
}
117+
}
118+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"openapi": "3.0.0",
3+
"info": {
4+
"version": "1.0.0",
5+
"title": "common-header"
6+
},
7+
"components": {
8+
"parameters": {
9+
"SourceHeader": {
10+
"description": "Source-System",
11+
"in": "header",
12+
"name": "Source-System",
13+
"schema": {
14+
"type": "string"
15+
},
16+
"required": true,
17+
"example": "SAP"
18+
},
19+
"TargetHeader": {
20+
"description": "Target-System",
21+
"in": "header",
22+
"name": "Target-System",
23+
"schema": {
24+
"type": "string"
25+
},
26+
"required": true,
27+
"example": "Salesforce"
28+
},
29+
"correlationId": {
30+
"in": "header",
31+
"name": "X-Correlation-Id",
32+
"schema": {
33+
"type": "string"
34+
},
35+
"required": true,
36+
"example": "1065fe6c-9121-4b05-b6e3-df5c0cb42461"
37+
}
38+
}
39+
}
40+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"openapi": "3.0.0",
3+
"info": {
4+
"version": "1.0.0",
5+
"title": "test-otr-eapi-request"
6+
},
7+
"components": {
8+
"examples": {
9+
"createAsset" : {
10+
"value" : [
11+
{
12+
"spanID": "ENGYALERT",
13+
"name": "EMAIL1",
14+
"description": "CCB_IDL_Provider"
15+
16+
}
17+
]
18+
},
19+
"createPreferences" : {
20+
"value" : [
21+
{
22+
"programID": "ENERGYALERT",
23+
"channelID": "EMAIL",
24+
"userID": "CCB_IDL_Provider",
25+
"customProperties": [
26+
{
27+
"link": 0
28+
}
29+
]
30+
},
31+
{
32+
"programID": "ENERGYALERT",
33+
"channelID": "EMAIL",
34+
"userID": "CCB_IDL_Provider",
35+
"customProperties": [
36+
{
37+
"link": 0
38+
}
39+
]
40+
}
41+
]
42+
}
43+
}
44+
}
45+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"openapi": "3.0.0",
3+
"info": {
4+
"version": "1.0.0",
5+
"title": "test-otr-eapi-response"
6+
},
7+
"components": {
8+
"examples" : {
9+
"createAsset" : {
10+
"value": {
11+
"id": "",
12+
"msg" : ""
13+
}
14+
},
15+
"createPreferences" : {
16+
"value": {
17+
"id": "",
18+
"msg" : ""
19+
}
20+
}
21+
}
22+
}
23+
24+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"openapi": "3.0.0",
3+
"info": {
4+
"version": "1.0.0",
5+
"title": "test-otr-eapi-request-schema"
6+
},
7+
"components": {
8+
"schemas": {
9+
"createAsset": {
10+
"type": "array",
11+
"items": {
12+
"type": "object",
13+
"properties": {
14+
"spanId": {
15+
"type": "string"
16+
},
17+
"name": {
18+
"type": "string"
19+
},
20+
"description": {
21+
"type": "string"
22+
}
23+
}
24+
}
25+
},
26+
"createPreferences": {
27+
"type": "array",
28+
"items": {
29+
"type": "object",
30+
"properties": {
31+
"programId": {
32+
"type": "string"
33+
},
34+
"channelId": {
35+
"type": "string"
36+
},
37+
"userId": {
38+
"type": "string"
39+
},
40+
"customProperties" : {
41+
"type" : "array",
42+
"items": {
43+
"type": "object",
44+
"properties": {
45+
"link": {
46+
"type": "integer"
47+
},
48+
"key": {
49+
"type": "string"
50+
},
51+
"value": {
52+
"type": "string"
53+
}
54+
}
55+
}
56+
}
57+
}
58+
}
59+
}
60+
}
61+
}
62+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"openapi": "3.0.0",
3+
"info": {
4+
"version": "1.0.0",
5+
"title": "test-otr-eapi-response-schema"
6+
},
7+
"components": {
8+
"schemas" : {
9+
"createAsset" : {
10+
"type" : "object",
11+
"properties": {
12+
"id" : {
13+
"type" : "string"
14+
},
15+
"msg" : {
16+
"type": "string"
17+
}
18+
}
19+
},
20+
"createPreferences" : {
21+
"type" : "object",
22+
"properties": {
23+
"id" : {
24+
"type" : "string"
25+
},
26+
"msg" : {
27+
"type": "string"
28+
}
29+
}
30+
}
31+
}
32+
}
33+
}

demo/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ class ComponentDemo extends ApiDemoPage {
126126
['W-11843862', 'W-11843862'],
127127
['W-17309546', 'W-17309546'],
128128
['W-17413312', 'W-17413312'],
129-
['v4_0_0_api_specs', 'v4_0_0_api_specs']
129+
['v4_0_0_api_specs', 'v4_0_0_api_specs'],
130+
['W-18830464', 'W-18830464']
130131
].map(
131132
([file, label]) => html`
132133
<anypoint-item data-src="${file}-compact.json"

demo/model.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@ files.set('xml-api/xml-api.yaml', { type: 'OAS 3.0', mime: 'application/yaml' })
3131
files.set('v4_0_0_api_spec/v4_0_0_api_specs.yaml', { type: 'OAS 3.0', mime: 'application/yaml' });
3232
files.set('W-11843862/W-11843862.yaml', { type: 'OAS 3.0', mime: 'application/yaml' });
3333
files.set('W-12428170/W-12428170.yaml', { type: 'OAS 2.0', mime: 'application/yaml' });
34+
files.set('W-18830464/W-18830464.json', { type: 'OAS 3.0', mime: 'application/json' });
3435

3536
generator.generate(files);

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)