Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decorator: @schema #6

Open
knownasilya opened this issue Sep 1, 2015 · 0 comments
Open

Decorator: @schema #6

knownasilya opened this issue Sep 1, 2015 · 0 comments

Comments

@knownasilya
Copy link
Owner

Controller level decorator

@schema('propertyId')
@schema(JoiObject)

To be used like so:

@controller('/users')
@schema('validation')
class Users {
  constructor(validation) {
    this.validation = validation
  }

  @put('/{id}')
  @validate()
  update (request, reply) {

  }

  @post('/')
  @validate(schema => schema.optionalKeys('id'))
  create (request, reply) {

  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant