Replies: 1 comment 3 replies
|
This JSON looks like Mealie JSON, which isn't necessarily |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I'm trying to write an import from Cheftap to Mealie and hitting some snags. Here's my code to create the recipe:
I've tried a couple of different payloads, to no avail. The full recipe gets me a
400:{"data":"{\"name\":\"Caramel Apple Cake\",\"description\":\"\",\"dateAdded\":\"2021-10-05\",\"notes\":\"\",\"recipeServings\":0,\"recipeYieldQuantity\":0,\"recipeYield\":null,\"recipeIngredient\":[{\"title\":\"Ingredients\",\"quantity\":1,\"note\":\"Use a 8 inch x 4 inch (20 cm x 10 cm) loaf pan\",\"display\":\"Use a 8 inch x 4 inch (20 cm x 10 cm) loaf pan\",\"unit\":null,\"food\":null,\"isFood\":false,\"disableAmount\":true,\"originalText\":null},{\"title\":\"For the cake\",\"quantity\":1,\"note\":\"190 g (1½ cups) All purpose flour\",\"display\":\"190 g (1½ cups) All purpose flour\",\"unit\":null,\"food\":null,\"isFood\":false,\"disableAmount\":true,\"originalText\":null},{\"title\":null,\"quantity\":1,\"note\":\"1 tsp Baking powder\",\"display\":\"1 tsp Baking powder\",\"unit\":null,\"food\":null,\"isFood\":false,\"disableAmount\":true,\"originalText\":null},{\"title\":null,\"quantity\":1,\"note\":\"¾ tsp Salt\",\"display\":\"¾ tsp Salt\",\"unit\":null,\"food\":null,\"isFood\":false,\"disableAmount\":true,\"originalText\":null},{\"title\":null,\"quantity\":1,\"note\":\"150 g (5.5 oz) Apples\",\"display\":\"150 g (5.5 oz) Apples\",\"unit\":null,\"food\":null,\"isFood\":false,\"disableAmount\":true,\"originalText\":null},{\"title\":null,\"quantity\":1,\"note\":\"100 g ( cup + 2 tbsp) Yogurt\",\"display\":\"100 g ( cup + 2 tbsp) Yogurt\",\"unit\":null,\"food\":null,\"isFood\":false,\"disableAmount\":true,\"originalText\":null},{\"title\":null,\"quantity\":1,\"note\":\"115 g (1 stick) Softened butter\",\"display\":\"115 g (1 stick) Softened butter\",\"unit\":null,\"food\":null,\"isFood\":false,\"disableAmount\":true,\"originalText\":null},{\"title\":null,\"quantity\":1,\"note\":\"150 g (¾ cup) Sugar\",\"display\":\"150 g (¾ cup) Sugar\",\"unit\":null,\"food\":null,\"isFood\":false,\"disableAmount\":true,\"originalText\":null},{\"title\":null,\"quantity\":1,\"note\":\"2 Large eggs\",\"display\":\"2 Large eggs\",\"unit\":null,\"food\":null,\"isFood\":false,\"disableAmount\":true,\"originalText\":null},{\"title\":null,\"quantity\":1,\"note\":\"1 tsp Vanilla extract\",\"display\":\"1 tsp Vanilla extract\",\"unit\":null,\"food\":null,\"isFood\":false,\"disableAmount\":true,\"originalText\":null},{\"title\":null,\"quantity\":1,\"note\":\"2 tbsp Milk to add to your apples\",\"display\":\"2 tbsp Milk to add to your apples\",\"unit\":null,\"food\":null,\"isFood\":false,\"disableAmount\":true,\"originalText\":null},{\"title\":null,\"quantity\":1,\"note\":\"1 tsp Cinnamon\",\"display\":\"1 tsp Cinnamon\",\"unit\":null,\"food\":null,\"isFood\":false,\"disableAmount\":true,\"originalText\":null},{\"title\":\"For the caramel whipped cream\",\"quantity\":1,\"note\":\"250 g (1 cup) Heavy cream\",\"display\":\"250 g (1 cup) Heavy cream\",\"unit\":null,\"food\":null,\"isFood\":false,\"disableAmount\":true,\"originalText\":null}],\"recipeInstructions\":[{\"title\":null,\"text\":\"5 - 6 tbsp Salted caramel (add to your liking)\"},{\"title\":\"For the cake\",\"text\":\"In a large bowl, cream together the butter, sugar and vanilla extract.\"},{\"title\":null,\"text\":\"Add the eggs one at the time.\"},{\"title\":null,\"text\":\"Add the yogurt and shredded apples and cinnamon.\"},{\"title\":null,\"text\":\"Add the sifted dry ingredients and mix just until combined.\"},{\"title\":null,\"text\":\"Pour the batter into a 8x4 inch loaf pan, greased and lined with parchment paper.\"},{\"title\":null,\"text\":\"Bake the cake in a preheated oven at 180 °C (360 °F) for one hour.\"},{\"title\":null,\"text\":\"Unmold the cake and allow to cool.\"},{\"title\":\"For the caramel whipped cream\",\"text\":\"Whip heavy cream and salted caramel together.\"}],\"orgURL\":\"https://www.emmafontanella.com/caramel-apple-cake\",\"@context\":\"https://schema.org\",\"@type\":\"Recipe\"}","includeTags":false}In another thread, I read something about sending just the name to create the recipe, then a
PUTto update it, but sending just that also gets a400:{"includeTags":false,"data":"{\"name\":\"Caramel Apple Cake\"}"}And sending just the JSON for the recipe gets me a
422:{"detail":[{"type":"missing","loc":["body","data"],"msg":"Field required","input":{...}]}What am I missing here? I've read other posts, looked at the Python script that was shared, and it looks like I'm doing the right thing, but I'm clearly not. :)
Thanks!
All reactions