Skip to content

Commit 5de0897

Browse files
post review changes and return x headers
1 parent 106b699 commit 5de0897

22 files changed

+147
-131
lines changed

sandbox/controllers/Controller.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Controller {
1313
*/
1414
Object.entries(payload.headers).forEach(([name, value]) => response.setHeader(name, String(value)));
1515
response.status(payload.code || 200);
16-
const responsePayload = payload.payload !== undefined ? payload.payload : payload;
16+
const responsePayload = payload.body !== undefined ? payload.body : payload;
1717
if (responsePayload instanceof Object) {
1818
response.json(responsePayload);
1919
} else {
@@ -92,12 +92,13 @@ class Controller {
9292

9393
if (request.openapi.schema.parameters !== undefined) {
9494
request.openapi.schema.parameters.forEach((param) => {
95+
9596
if (param.in === 'path') {
9697
requestParams[param.name] = request.openapi.pathParams[param.name];
9798
} else if (param.in === 'query') {
9899
requestParams[param.name] = request.query[param.name];
99100
} else if (param.in === 'header') {
100-
requestParams[param.name] = request.headers[param.name];
101+
requestParams[camelCase(param.name)] = request.headers[param.name.toLowerCase()];
101102
}
102103
});
103104
}

sandbox/data/examples/getLetter/responses/getLetter-24L5eYSWGzCHlGmzNxuqVusPxDg.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"data": {
33
"attributes": {
4+
"groupId": "c5d93f917f5546d08beccf770a915d96",
45
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
56
"status": "PENDING"
67
},

sandbox/data/examples/getLetter/responses/getLetter-2AL5eYSWGzCHlGmzNxuqVusPxDg.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"data": {
33
"attributes": {
4+
"groupId": "c5d93f917f5546d08beccf770a915d96",
45
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
56
"status": "ACCEPTED"
67
},

sandbox/data/examples/getLetter/responses/getLetter-2BL5eYSWGzCHlGmzNxuqVusPxDg.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"data": {
33
"attributes": {
4+
"groupId": "c5d93f917f5546d08beccf770a915d96",
45
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
56
"status": "PRINTED"
67
},

sandbox/data/examples/getLetter/responses/getLetter-2CL5eYSWGzCHlGmzNxuqVusPxDg.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"data": {
33
"attributes": {
4+
"groupId": "c5d93f917f5546d08beccf770a915d96",
45
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
56
"status": "ENCLOSED"
67
},

sandbox/data/examples/getLetter/responses/getLetter-2DL5eYSWGzCHlGmzNxuqVusPxDg.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"data": {
33
"attributes": {
4+
"groupId": "c5d93f917f5546d08beccf770a915d96",
45
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
56
"status": "DISPATCHED"
67
},

sandbox/data/examples/getLetter/responses/getLetter-2EL5eYSWGzCHlGmzNxuqVusPxDg.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"data": {
33
"attributes": {
4+
"groupId": "c5d93f917f5546d08beccf770a915d96",
45
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
56
"status": "DELIVERED"
67
},

sandbox/data/examples/getLetter/responses/getLetter-2WL5eYSWGzCHlGmzNxuqVusPxDg.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"data": {
33
"attributes": {
4+
"groupId": "c5d93f917f5546d08beccf770a915d96",
45
"reasonCode": 100,
56
"reasonText": "failed validation",
67
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",

sandbox/data/examples/getLetter/responses/getLetter-2XL5eYSWGzCHlGmzNxuqVusPxDg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"data": {
33
"attributes": {
4+
"groupId": "c5d93f917f5546d08beccf770a915d96",
45
"reasonCode": 100,
5-
"reasonText": "failed validation",
66
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",
77
"status": "CANCELLED"
88
},

sandbox/data/examples/getLetter/responses/getLetter-2YL5eYSWGzCHlGmzNxuqVusPxDg.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"data": {
33
"attributes": {
4+
"groupId": "c5d93f917f5546d08beccf770a915d96",
45
"reasonCode": 100,
56
"reasonText": "failed validation",
67
"specificationId": "2WL5eYSWGzCHlGmzNxuqVusPxDg",

0 commit comments

Comments
 (0)