Skip to content

metadata_get returns None for nested metadata values #92

@kei-sidorov

Description

@kei-sidorov

When a recipe has nested YAML metadata like nutrition with sub-keys (calories, fat, etc.), metadata_get returns None for that key. The key correctly appears in metadata_custom_keys, but its value is inaccessible through the bindings.

This means apps have no way to display nested custom metadata.

Suggested solutions

  1. New function — add something like metadata_get_map that returns a list of key-value pairs for map-valued metadata
  2. Fallback serialization — when the value is not a scalar string, serialize it to YAML or JSON string and return that from metadata_get
  3. Dedicated nutrition API — if nutrition is considered a standard metadata type, add a metadata_nutrition function similar to metadata_time or metadata_servings

Recipe sample

---
title: Greek Peas With Potatoes and Carrots (Arakas)
description: This classic Greek arakas—peas braised with potatoes, carrots, and tomatoes—is an easy one-pot side dish that’s make-ahead friendly and perfect for spring.
image: https://www.seriouseats.com/thmb/UDYes4JFM7J6XZnikUqMCJLi1ck=/1500x0/filters:no_upscale():max_bytes(150000):strip_icc()/20260317-SEA-Arakas-Mateja-Zvirotic-Andrijanic-HERO-9309eb1f91cd4d34b3993c58e66bb924.jpg
time required: 1 hour 15 minutes
course: Dinner, Side Dish
author: Sharon Brenner
tags: Arakas Recipe, Greek Peas With Potatoes and Carrots Recipe, Greek Potato Recipe
nutrition: 
  calories: 263 kcal
  fat: 12 g
  saturated fat: 2 g
  carbohydrates: 34 g
  sugar: 8 g
  protein: 7 g
  fiber: 7 g
  sodium: 646 mg
source: https://www.seriouseats.com/arakas-greek-peas-with-potatoes-recipe-11928028
servings: 8
prep time: 15 minutes
cook time: 45 minutes
cuisine: Greek
---

In a large heavy-bottomed #saucepot{}, heat @olive oil{3%tbsp} over medium-high until shimmering. Add @onion{1}(diced) and @salt{1%tsp} and cook until onion is softened and translucent, about ~{7%minutes}.

Add @carrots{3}(cut into 1-inch-thick rounds), @garlic{1}(minced), @tomato paste{1%tbsp}, @miso paste{2%tbsp}, and @olive oil{1%tbsp}, and cook, stirring constantly, until garlic is fragrant, about ~{1%minute}. Add @potatoes{2}(cut into 1 1/2-inch pieces), @diced tomatoes{1%14.5oz can}, and remaining @salt{1%tsp}, and stir to combine.

Add just enough water to cover potatoes (about 2 about cups). Cover with the lid and bring to a boil, then remove lid and reduce heat to medium-low to maintain a simmer, and cook until the potatoes are fork-tender, ~{15-20%minutes}.

Add @peas{1%454g}, @dill{1/2%cup}(chopped), and remaining @olive oil{2%tbsp}, and stir to combine. Continue cooking on medium heat, uncovered, stirring occasionally, until peas are heated and cooked through, and sauce has thickened and coats the peas and potatoes (it should not be watery or soupy), an additional ~{5-8%minutes}.

Add @lemon juice{1%tbsp} or @apple cider vinegar{1%tbsp}, season to taste with @salt{}, and @ground black pepper{} to taste, stir to combine, and let sit for about ~{10%minutes} to cool slightly. Serve warm or at room temperature, garnished with more @olive oil{} and a side of @feta cheese{} and @crusty bread{} or @pita{}.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions