diff --git a/packages/example-getting-started/docs/7-controller.md b/packages/example-getting-started/docs/7-controller.md index 0c032f9da31d..96bc4d5b691f 100644 --- a/packages/example-getting-started/docs/7-controller.md +++ b/packages/example-getting-started/docs/7-controller.md @@ -61,6 +61,7 @@ export class TodoController { constructor( @repository(TodoRepository.name) protected todoRepo: TodoRepository, ) {} + @post('/todo') @param.body('todo', TodoSchema) async createTodo(todo: Todo) { @@ -79,7 +80,8 @@ metadata about the route, verb and the format of the incoming request body: redirect requests to this function when the path and verb match. - `@param.body('todo', TodoSchema)` associates the OpenAPI schema for a Todo with the body of the request so that LoopBack can validate the format of an -incoming request (**Note**: As of this writing, this is not yet functional). +incoming request (**Note**: As of this writing, schematic validation is not yet +functional). We've also added our own validation logic to ensure that a user will receive an error if they fail to provide a `title` property with their @@ -103,6 +105,7 @@ export class TodoController { constructor( @repository(TodoRepository.name) protected todoRepo: TodoRepository, ) {} + @post('/todo') @param.body('todo', TodoSchema) async createTodo(todo: Todo) {