Skip to content

Add Mealie V3 ingredient fields#664

Merged
andrew-codechimp merged 5 commits into
joostlek:mainfrom
Matthijsy:feature/mealie-v3-ingredients
Jan 16, 2026
Merged

Add Mealie V3 ingredient fields#664
andrew-codechimp merged 5 commits into
joostlek:mainfrom
Matthijsy:feature/mealie-v3-ingredients

Conversation

@Matthijsy

Copy link
Copy Markdown
Contributor

Proposed Changes

I am running Mealie version 3.9.2, and this seems to return more ingredient data when requesting a recipe than currently parsed in the models. When I request a recipe using GET /api/recipes/<recipe_id> every element under ingredients looks like this:

{
           "quantity": 10.0,
            "unit": {
                "id": "redacted",
                "name": "ml",
                "pluralName": "ml",
                "description": "",
                "extras": {},
                "fraction": true,
                "abbreviation": "tl",
                "pluralAbbreviation": null,
                "useAbbreviation": false,
                "aliases": [],
                "createdAt": "2025-01-01T00:00:00.000000Z",
                "updatedAt": "2025-01-01T00:00:00.000000Z"
            },
            "food": {
                "id": "redacted",
                "name": "milk",
                "pluralName": null,
                "description": "",
                "extras": {},
                "labelId": null,
                "aliases": [],
                "householdsWithIngredientFood": [],
                "label": null,
                "createdAt": "2025-01-01T00:00:00.000000Z",
                "updatedAt": "2025-01-01T00:00:00.000000Z"
            },
            "referencedRecipe": null,
            "note": "",
            "display": "10 ml milk",
            "title": null,
            "originalText": null,
            "referenceId": "redacted"
        },

This actually means that we now can obtain the list of needed ingredients, instead of only having some references. This PR adds these new fields into the ingredients model.

Comment thread src/aiomealie/models.py Outdated
@andrew-codechimp andrew-codechimp added the new-feature New features or options. label Jan 5, 2026
Comment thread src/aiomealie/models.py Outdated
@andrew-codechimp

Copy link
Copy Markdown
Collaborator

Hi, this will be a nice addition as Mealie has started adding a lot more detail on the recipe which could be useful for LLM use within Home Assistant.
Along with the model change we will need the test fixtures/snapshots updating for this to pass.

@Matthijsy

Copy link
Copy Markdown
Contributor Author

Thanks! I just added the Food model, there is no documentation on it so I did it based on the returned data by the API.

For the tests, how are the fixtures generated? Should I adapt them by hand, or can we regenerate them to match the V3 version?

@andrew-codechimp

Copy link
Copy Markdown
Collaborator

You can manually update the recipe.json file, probably best to add some new ones at the end, we'd want to at least test the complex optional fields being there or not.

To regenerate the snapshot use pytest ./tests/ --snapshot-update

@andrew-codechimp

Copy link
Copy Markdown
Collaborator

Just a couple of aliases to snake case missing, you'll need to regen your snapshot as well

@andrew-codechimp andrew-codechimp merged commit 9cd4507 into joostlek:main Jan 16, 2026
12 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

new-feature New features or options.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants