Skip to content

Commit 9a7913b

Browse files
author
Agnes Lin
committed
docs: update docs for template changes
1 parent 5e45ae2 commit 9a7913b

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

docs/site/Controller-generator.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,19 @@ export class TodoController {
202202
responses: {
203203
'200': {
204204
description: 'Todo model instance',
205-
content: {'application/json': {schema: getModelSchemaRef(Todo)}},
205+
content: {
206+
'application/json': {
207+
schema: getModelSchemaRef(Todo, {includeRelations: true}),
208+
},
209+
},
206210
},
207211
},
208212
})
209-
async findById(@param.path.number('id') id: number): Promise<Todo> {
210-
return this.todoRepository.findById(id);
213+
async findById(
214+
@param.path.number('id') id: number,
215+
@param.query.object('filter', getFilterSchemaFor(Todo)) filter?: Filter<Todo>
216+
): Promise<Todo> {
217+
return this.todoRepository.findById(id, filter);
211218
}
212219

213220
@patch('/todos/{id}', {

docs/site/Sequence.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,15 +231,24 @@ from the path object.
231231
responses: {
232232
'200': {
233233
description: 'Note model instance',
234-
content: {'application/json': {schema: getModelSchemaRef(Note)}},
234+
content: {
235+
'application/json': {
236+
schema: getModelSchemaRef(Note, {includeRelations: true}),
237+
},
238+
},
235239
},
236240
},
237241
})
238-
async findById(@param.path.string('id') id: string): Promise<Note> {
239-
return this.noteRepository.findById(id);
242+
async findById(
243+
@param.path.string('id') id: string,
244+
@param.query.object('filter', getFilterSchemaFor(Note)) filter?: Filter<Note>
245+
): Promise<Note> {
246+
return this.noteRepository.findById(id, filter);
240247
}
241248
```
242249

250+
(Notice: the filter for `findById()` method only supports the `include` clause for now.)
251+
243252
You can also specify a parameter which is an object value encoded as a JSON
244253
string or in multiple nested keys. For a JSON string, a sample value would be
245254
`location={"lang": 23.414, "lat": -98.1515}`. For the same `location` object, it
@@ -378,7 +387,7 @@ details.
378387
```
379388

380389
During development and testing, it may be useful to see all error details in the
381-
HTTP responsed returned by the server. This behavior can be enabled by enabling
390+
HTTP response returned by the server. This behavior can be enabled by enabling
382391
the `debug` flag in error-handler configuration as shown in the code example
383392
below. See strong-error-handler
384393
[docs](https://github.com/strongloop/strong-error-handler#options) for a list of

0 commit comments

Comments
 (0)