Skip to content

Commit fe2496b

Browse files
committed
feat: add model in get response
Signed-off-by: Muhammad Aaqil <aaqilcs102@gmail.com>
1 parent 9014d9b commit fe2496b

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

packages/rest-crud/src/crud-rest.controller.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,19 @@ export function defineCrudRestController<
156156
) {}
157157

158158
@get('/', {
159-
...response.array(200, `Array of ${modelName} instances`, modelCtor, {
160-
includeRelations: true,
161-
}),
159+
responses: {
160+
'200': {
161+
description: `Array of ${modelName} instances`,
162+
content: {
163+
'application/json': {
164+
schema: {
165+
type: 'array',
166+
items: getModelSchemaRef(modelCtor, {includeRelations: true}),
167+
},
168+
},
169+
},
170+
},
171+
},
162172
})
163173
async find(
164174
@param.filter(modelCtor)

0 commit comments

Comments
 (0)