Skip to content

Commit

Permalink
docs(example-getting-started): fix fix fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Delisle committed Feb 27, 2018
1 parent 0051fe3 commit f6d67cf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/example-getting-started/docs/7-controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export class TodoController {
constructor(
@repository(TodoRepository.name) protected todoRepo: TodoRepository,
) {}

@post('/todo')
@param.body('todo', TodoSchema)
async createTodo(todo: Todo) {
Expand All @@ -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
Expand All @@ -103,6 +105,7 @@ export class TodoController {
constructor(
@repository(TodoRepository.name) protected todoRepo: TodoRepository,
) {}

@post('/todo')
@param.body('todo', TodoSchema)
async createTodo(todo: Todo) {
Expand Down

0 comments on commit f6d67cf

Please sign in to comment.