Skip to content

Commit afd58e7

Browse files
Further examples and scripts
1 parent b07b0b8 commit afd58e7

File tree

47 files changed

+853
-116
lines changed

Some content is hidden

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

47 files changed

+853
-116
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ lint-oas:
4040
npm run lint-oas
4141

4242
publish-oas:
43+
$(MAKE) copy-examples
4344
npm run publish-oas
4445

4546
set-target: guard-APIM_ENV
@@ -74,9 +75,11 @@ build-yml-oas-spec: guard-APIM_ENV
7475
$(MAKE) bundle-oas
7576

7677
serve-oas:
78+
$(MAKE) copy-examples
7779
npm run serve-oas
7880

7981
bundle-oas:
82+
$(MAKE) copy-examples
8083
npm run bundle-oas
8184

8285
generate-sandbox:
@@ -88,6 +91,9 @@ generate-sandbox:
8891
serve-swagger:
8992
npm run serve-swagger-docs
9093

94+
copy-examples:
95+
cp -r ./sandbox/data/examples/. ./specification/api/components/examples
96+
9197
config:: _install-dependencies version # Configure development environment (main) @Configuration
9298
npm install
9399
(cd docs && make install && cd ..)

sandbox/controllers/Controller.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ class Controller {
2020
} else {
2121
response.end(responsePayload);
2222
}
23-
console.log('response:', response);
2423
}
2524

2625
static sendError(response, error) {

sandbox/data/examples/createMI/requests/createMI_INVALID.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"data": {
33
"attributes": {
4-
"cost": 10.25,
5-
"lineItem": "Letter",
4+
"lineItem": "envelope-business-standard",
65
"quantity": 22,
76
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
87
"stockRemaining": 2000,

sandbox/data/examples/createMI/requests/createMI_NOTFOUND.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"data": {
33
"attributes": {
4-
"cost": 10.25,
5-
"lineItem": "Letter",
4+
"lineItem": "envelope-business-standard",
65
"quantity": 22,
76
"specificationId": "123456",
87
"stockRemaining": 2000,

sandbox/data/examples/createMI/requests/createMI_SUCCESS.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"data": {
33
"attributes": {
4-
"cost": 10.25,
5-
"lineItem": "Letter",
4+
"lineItem": "envelope-business-standard",
65
"quantity": 22,
76
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
87
"stockRemaining": 2000,

sandbox/data/examples/createMI/responses/createMI_SUCCESS.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"data": {
33
"attributes": {
4-
"cost": 10.25,
5-
"lineItem": "Letter",
4+
"lineItem": "envelope-business-standard",
65
"quantity": 22,
76
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
87
"stockRemaining": 2000,

specification/api/components/examples/errors/responses/listLetters/limitInvalidValue.json renamed to sandbox/data/examples/errors/responses/getLetter/limitInvalidValue.json

File renamed without changes.

specification/api/components/examples/errors/responses/listLetters/unknownParameter.json renamed to sandbox/data/examples/errors/responses/getLetter/unknownParameter.json

File renamed without changes.

sandbox/data/examples/getLetters/responses/getLetters_pending.json

Lines changed: 36 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,213 +2,206 @@
22
"data": [
33
{
44
"attributes": {
5-
"groupId": "abc123",
6-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
75
"groupId": "c5d93f917f5546d08beccf770a915d96",
6+
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
87
"status": "PENDING"
98
},
109
"id": "fcfd849ceec940e8832b41f4fc161e09",
1110
"type": "Letter"
1211
},
1312
{
1413
"attributes": {
15-
"groupId": "abc123",
16-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
1714
"groupId": "c5d93f917f5546d08beccf770a915d96",
15+
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
1816
"status": "PENDING"
1917
},
2018
"id": "7d64bd6a49e14213b47abbf6357eba0c",
2119
"type": "Letter"
2220
},
2321
{
2422
"attributes": {
25-
"groupId": "abc123",
26-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
2723
"groupId": "c5d93f917f5546d08beccf770a915d96",
24+
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
2825
"status": "PENDING"
2926
},
3027
"id": "2c06e7e32db4445fbbf56e7af223e0a2",
3128
"type": "Letter"
3229
},
3330
{
3431
"attributes": {
35-
"groupId": "abc123",
36-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
3732
"groupId": "c5d93f917f5546d08beccf770a915d96",
33+
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
3834
"status": "PENDING"
3935
},
4036
"id": "3b302a6122854695b5c514a4d28d18d5",
4137
"type": "Letter"
4238
},
4339
{
4440
"attributes": {
45-
"groupId": "abc123",
46-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
4741
"groupId": "c5d93f917f5546d08beccf770a915d96",
42+
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
4843
"status": "PENDING"
4944
},
5045
"id": "fbe3a53aac764a17a834699b8779958c",
5146
"type": "Letter"
5247
},
5348
{
5449
"attributes": {
55-
"groupId": "abc123",
56-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
5750
"groupId": "c5d93f917f5546d08beccf770a915d96",
51+
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
5852
"status": "PENDING"
5953
},
6054
"id": "393056c7cdc649deb29ee8d2651f29dd",
6155
"type": "Letter"
6256
},
6357
{
6458
"attributes": {
65-
"groupId": "abc123",
66-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
6759
"groupId": "c5d93f917f5546d08beccf770a915d96",
60+
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
6861
"status": "PENDING"
6962
},
7063
"id": "c6d0d4243f004b4e844003fbf80a9105",
7164
"type": "Letter"
7265
},
7366
{
7467
"attributes": {
75-
"specificationId": "853817f0-d797-4eb2-bf40-2879a9b58117",
7668
"groupId": "c5d93f917f5546d08beccf770a915d96",
69+
"specificationId": "853817f0-d797-4eb2-bf40-2879a9b58117",
7770
"status": "PENDING"
7871
},
7972
"id": "03aa3fb76d544ad483984bdd7fcd900b",
8073
"type": "Letter"
8174
},
8275
{
8376
"attributes": {
84-
"specificationId": "9e5d5da7-5991-4ac9-9cee-559769912ca5",
8577
"groupId": "c5d93f917f5546d08beccf770a915d96",
78+
"specificationId": "9e5d5da7-5991-4ac9-9cee-559769912ca5",
8679
"status": "PENDING"
8780
},
8881
"id": "7c9b698bf434479cabd0af946cc93f95",
8982
"type": "Letter"
9083
},
9184
{
9285
"attributes": {
93-
"specificationId": "634bcc87-fcc3-41fe-b6f9-c6a2125758e6",
9486
"groupId": "c5d93f917f5546d08beccf770a915d96",
87+
"specificationId": "634bcc87-fcc3-41fe-b6f9-c6a2125758e6",
9588
"status": "PENDING"
9689
},
9790
"id": "987276fd0dc94ddbab607d4a24693db2",
9891
"type": "Letter"
9992
},
10093
{
10194
"attributes": {
102-
"groupId": "abc123",
103-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
95+
"groupId": "c5d93f917f5546d08beccf770a915d96",
96+
"specificationId": "634bcc87-fcc3-41fe-b6f9-c6a2125758e6",
10497
"status": "PENDING"
10598
},
10699
"id": "32mAKk67isO29atr37M40VV8h4t",
107100
"type": "Letter"
108101
},
109102
{
110103
"attributes": {
111-
"groupId": "abc123",
112-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
104+
"groupId": "c5d93f917f5546d08beccf770a915d96",
105+
"specificationId": "634bcc87-fcc3-41fe-b6f9-c6a2125758e6",
113106
"status": "PENDING"
114107
},
115108
"id": "32mAKiDtfmA1SCybeljxWaXsTO4",
116109
"type": "Letter"
117110
},
118111
{
119112
"attributes": {
120-
"groupId": "abc123",
121-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
113+
"groupId": "c5d93f917f5546d08beccf770a915d96",
114+
"specificationId": "634bcc87-fcc3-41fe-b6f9-c6a2125758e6",
122115
"status": "PENDING"
123116
},
124117
"id": "32mAKeUmf6fBK2aCc5tK2AV8NLo",
125118
"type": "Letter"
126119
},
127120
{
128121
"attributes": {
129-
"groupId": "abc123",
130-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
122+
"groupId": "c5d93f917f5546d08beccf770a915d96",
123+
"specificationId": "634bcc87-fcc3-41fe-b6f9-c6a2125758e6",
131124
"status": "PENDING"
132125
},
133126
"id": "32mAKg0opQaKuPrBaA11MGPTX1p",
134127
"type": "Letter"
135128
},
136129
{
137130
"attributes": {
138-
"groupId": "abc123",
139-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
131+
"groupId": "c5d93f917f5546d08beccf770a915d96",
132+
"specificationId": "634bcc87-fcc3-41fe-b6f9-c6a2125758e6",
140133
"status": "PENDING"
141134
},
142135
"id": "32mAKjTJgMPTE4HdpgTvJcUmmW7",
143136
"type": "Letter"
144137
},
145138
{
146139
"attributes": {
147-
"groupId": "abc123",
148-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
140+
"groupId": "c5d93f917f5546d08beccf770a915d96",
141+
"specificationId": "634bcc87-fcc3-41fe-b6f9-c6a2125758e6",
149142
"status": "PENDING"
150143
},
151144
"id": "32mAKfx3DNyUmzXMZ4zby3vh5gi",
152145
"type": "Letter"
153146
},
154147
{
155148
"attributes": {
156-
"groupId": "abc123",
157-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
149+
"groupId": "c5d93f917f5546d08beccf770a915d96",
150+
"specificationId": "634bcc87-fcc3-41fe-b6f9-c6a2125758e6",
158151
"status": "PENDING"
159152
},
160153
"id": "32mAKlVCTgh4h1sTw6aiVcFdIwv",
161154
"type": "Letter"
162155
},
163156
{
164157
"attributes": {
165-
"groupId": "abc123",
166-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
158+
"groupId": "c5d93f917f5546d08beccf770a915d96",
159+
"specificationId": "634bcc87-fcc3-41fe-b6f9-c6a2125758e6",
167160
"status": "PENDING"
168161
},
169162
"id": "32mAKirJUuWKB3aoGr6KkFObelC",
170163
"type": "Letter"
171164
},
172165
{
173166
"attributes": {
174-
"groupId": "abc123",
175-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
167+
"groupId": "c5d93f917f5546d08beccf770a915d96",
168+
"specificationId": "634bcc87-fcc3-41fe-b6f9-c6a2125758e6",
176169
"status": "PENDING"
177170
},
178171
"id": "32mAKiUtgkjc3rS0xIYsqDOYYT4",
179172
"type": "Letter"
180173
},
181174
{
182175
"attributes": {
183-
"groupId": "abc123",
184-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
176+
"groupId": "c5d93f917f5546d08beccf770a915d96",
177+
"specificationId": "634bcc87-fcc3-41fe-b6f9-c6a2125758e6",
185178
"status": "PENDING"
186179
},
187180
"id": "32mAKiQJZr3k2TBYboLgUWlR5NO",
188181
"type": "Letter"
189182
},
190183
{
191184
"attributes": {
192-
"groupId": "abc123",
193-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
185+
"groupId": "c5d93f917f5546d08beccf770a915d96",
186+
"specificationId": "634bcc87-fcc3-41fe-b6f9-c6a2125758e6",
194187
"status": "PENDING"
195188
},
196189
"id": "32mAfv3V8RlfqSXOOtIZzNdjBFK",
197190
"type": "Letter"
198191
},
199192
{
200193
"attributes": {
201-
"groupId": "abc123",
202-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
194+
"groupId": "c5d93f917f5546d08beccf770a915d96",
195+
"specificationId": "634bcc87-fcc3-41fe-b6f9-c6a2125758e6",
203196
"status": "PENDING"
204197
},
205198
"id": "32mAft7hTg2lKQhXhAxbPQTBudU",
206199
"type": "Letter"
207200
},
208201
{
209202
"attributes": {
210-
"groupId": "abc123",
211-
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
203+
"groupId": "c5d93f917f5546d08beccf770a915d96",
204+
"specificationId": "634bcc87-fcc3-41fe-b6f9-c6a2125758e6",
212205
"status": "PENDING"
213206
},
214207
"id": "32mAfv2nn1a9Kbfh4z19OyZw8Fo",

sandbox/data/examples/postLetter/requests/postLetter.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)