FoodRecipeSuggestRequest food.recipe-suggest-request@1

Generated at from openvibe-contracts v0.150.0 and openvibe-sdk v0.44.0.

Version
1.0.0
Owner
food
Visibility
public
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/food/recipe-suggest-request.v1.json

food.recipe-suggest-request@1: POST /api/v1/recipes/suggest. Asks OpenVibe.AI's food.suggest_recipes workflow for up to three recipes from the caller's saved pantry (an empty pantry is 422 food.pantry_empty). 10 a person a day (429 food.recipes_daily_limit); with Food's AI connection off, 503 food.ai_off.

Fields

FieldTypeRequiredDescriptionConstraints
askstring
  • maxLength 500
peopleinteger
  • minimum 1
  • maximum 12

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: ask
{
  "ask": "something quick and filling",
  "people": 2
}
Valid: empty
{}
Rejected: too-many-people
{
  "people": 40
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('food.recipe-suggest-request@1', value);   // { valid, errors: [{ path, message }] }