Created
February 11, 2014 00:47
-
-
Save nvcexploder/8927290 to your computer and use it in GitHub Desktop.
Route validation config showing nested Joi configuration objects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.create = { | |
description: 'Creates a new cart', | |
validate: { | |
payload: { | |
location: Joi.object({ | |
postalCode: Joi.string().required().description('Postal Code'), | |
city: Joi.string().optional().description('City'), | |
state: Joi.string().optional().description('State or Province Code'), | |
country: Joi.string().optional().description('Country') | |
}).optional().description('Cart Location'), | |
storeFrontId: Joi.object({ | |
USStoreId: Joi.number().required().description('US Store ID') | |
}).optional().description('StoreFront ID'), | |
currencyCode: Joi.string().optional().description('Currency Code'), | |
customerId: Joi.string().optional().description('Customer UUID') | |
}, | |
failAction: 'log' | |
}, | |
handler: function createCart (request, reply) { | |
reply(new Cart()); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment