Skip to content

Commit

Permalink
fix: Correct find blueprint to return array of models
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsharvey authored and theoomoregbee committed Jun 4, 2020
1 parent 0de0e3e commit 66db3dd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/type-formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const blueprintActionTemplates: BlueprintActionTemplates = {
{ $ref: '#/components/parameters/SortQueryParam' },
],
resultDescription: 'Responds with a paged list of **{globalId}** records that match the specified criteria',
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]
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]
},
create: {
summary: 'Create {globalId}',
Expand Down
20 changes: 16 additions & 4 deletions test/fixtures/generatedSwagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,10 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/user"
"type": "array",
"items": {
"$ref": "#/components/schemas/user"
}
}
}
}
Expand Down Expand Up @@ -828,7 +831,10 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/pet"
"type": "array",
"items": {
"$ref": "#/components/schemas/pet"
}
}
}
}
Expand Down Expand Up @@ -1172,7 +1178,10 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/user"
"type": "array",
"items": {
"$ref": "#/components/schemas/user"
}
}
}
}
Expand Down Expand Up @@ -1720,7 +1729,10 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/pet"
"type": "array",
"items": {
"$ref": "#/components/schemas/pet"
}
}
}
}
Expand Down

0 comments on commit 66db3dd

Please sign in to comment.