openfoodfacts / openfoodfacts-server

Open Food Facts database, API server and web interface - 🐪🦋 Perl, CSS and JS coders welcome 😊 For helping in Python, see Robotoff or taxonomy-editor
http://openfoodfacts.github.io/openfoodfacts-server/
GNU Affero General Public License v3.0
661 stars 389 forks source link

OpenAPI: document getting a specific nutrient field #7944

Open alexgarel opened 1 year ago

alexgarel commented 1 year ago

In API.pm, customize_response_for_product

        # Apps can request the full nutriments hash
        # or specific nutrients:
        # - saturated-fat_prepared_100g : return field at top level
        # - nutrients|nutriments.sugars_serving : return field in nutrients / nutriments hash
        elsif ($field =~ /^((nutrients|nutriments)\.)?((.*)_(100g|serving))$/) {

So those works:

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 90 days with no activity.