Skip to content
New issue

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

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

Already on GitHub? # to your account

Harvester should enforce joi validation provided in the schema, and overriding/extending that validation. #86

Open
ssebro opened this issue May 26, 2015 · 1 comment

Comments

@ssebro
Copy link

ssebro commented May 26, 2015

    var category = harvester
        .resource('categories', {
            name: Joi.string().required().description('a name'),
            links: {
                brand: 'brands'
            }
        });

    var validation = {
        get: {query: {myAwesomeParam: Joi.string().required().description('My awesome parameter')}}
    };
    //Overrides built-in joi validation of query.
    category.get().validate(validation.get).register();
@ssebro ssebro changed the title Validation Harvester should enforce joi validation provided in the schema, and overriding/extending that validation. May 26, 2015
@ssebro
Copy link
Author

ssebro commented May 26, 2015

Note: the passed in validation object should be able to take query, body and header values.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant