Skip to content

Commit 66db3dd

Browse files
danielsharveytheoomoregbee
authored andcommitted
fix: Correct find blueprint to return array of models
1 parent 0de0e3e commit 66db3dd

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

lib/type-formatter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export const blueprintActionTemplates: BlueprintActionTemplates = {
9999
{ $ref: '#/components/parameters/SortQueryParam' },
100100
],
101101
resultDescription: 'Responds with a paged list of **{globalId}** records that match the specified criteria',
102-
modifiers:[Modifiers.ADD_SELECT_QUERY_PARAM, Modifiers.ADD_OMIT_QUERY_PARAM, Modifiers.ADD_POPULATE_QUERY_PARAM, Modifiers.ADD_RESULT_OF_MODEL, Modifiers.ADD_SHORTCUT_BLUEPRINT_ROUTE_NOTE]
102+
modifiers:[Modifiers.ADD_SELECT_QUERY_PARAM, Modifiers.ADD_OMIT_QUERY_PARAM, Modifiers.ADD_POPULATE_QUERY_PARAM, Modifiers.ADD_RESULT_OF_ARRAY_OF_MODELS, Modifiers.ADD_SHORTCUT_BLUEPRINT_ROUTE_NOTE]
103103
},
104104
create: {
105105
summary: 'Create {globalId}',

test/fixtures/generatedSwagger.json

+16-4
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,10 @@
339339
"content": {
340340
"application/json": {
341341
"schema": {
342-
"$ref": "#/components/schemas/user"
342+
"type": "array",
343+
"items": {
344+
"$ref": "#/components/schemas/user"
345+
}
343346
}
344347
}
345348
}
@@ -828,7 +831,10 @@
828831
"content": {
829832
"application/json": {
830833
"schema": {
831-
"$ref": "#/components/schemas/pet"
834+
"type": "array",
835+
"items": {
836+
"$ref": "#/components/schemas/pet"
837+
}
832838
}
833839
}
834840
}
@@ -1172,7 +1178,10 @@
11721178
"content": {
11731179
"application/json": {
11741180
"schema": {
1175-
"$ref": "#/components/schemas/user"
1181+
"type": "array",
1182+
"items": {
1183+
"$ref": "#/components/schemas/user"
1184+
}
11761185
}
11771186
}
11781187
}
@@ -1720,7 +1729,10 @@
17201729
"content": {
17211730
"application/json": {
17221731
"schema": {
1723-
"$ref": "#/components/schemas/pet"
1732+
"type": "array",
1733+
"items": {
1734+
"$ref": "#/components/schemas/pet"
1735+
}
17241736
}
17251737
}
17261738
}

0 commit comments

Comments
 (0)