Repository navigation
Remove non-existent recipeSlug field from RecipeRating - #814
Merged
Merged
Conversation
The Mealie API never returns this field: GET /api/users/self/favorites responds with UserRatings[UserRatingSummary], whose items only expose recipeId, rating and isFavorite. The attribute was therefore always None. Update the test fixture and snapshot to match the real API response.
andrew-codechimp
approved these changes
Aug 5, 2026
Contributor
Author
|
Thanks @andrew-codechimp |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
RecipeRatingdeclares arecipe_slugattribute mapped to therecipeSlugalias, but the Mealie API never returns such a field, so the attribute was alwaysNone.Checking the
openapi.jsonvendored in this repository:GET /api/users/self/favoritesandGET /api/users/self/ratingsreturnUserRatings[UserRatingSummary], andUserRatingSummaryonly definesrecipeId,ratingandisFavorite.GET /api/users/{id}/favoritesandGET /api/users/{id}/ratingsreturnUserRatings[UserRatingOut], which addsuserIdandid— still no slug.The field was introduced in #738 (my own PR), so this is a follow-up fix on my side.
This PR:
recipe_slugfromRecipeRating;recipeSlugkeys fromtests/fixtures/recipe_favorites.json, so thefixture matches a real API response;
test_get_recipe_favoritessnapshot accordingly.RecipeRatingis part of the public API (exported fromaiomealie/__init__.py), so strictly speaking this removes a public attribute. Since it could only ever beNone, no caller can meaningfully depend on its value. Callers that need a slug are unaffected:add_recipe_favorite,remove_recipe_favoriteandrate_recipealready take the slug as an argument, and it can be resolved fromrecipe_idthrough the recipe endpoints.