ProductOpener::APIProductServices - Microservices to enrich a product object
This module implements a microservice API for operations done on an product object.
Applications can send product data (for instance a nested list of ingredients), ask for one or more services to be executed on the input product data (for instance computing the min, max and estimated percentages of each ingredient), and get back resulting product data (possibly filtered to get only specific fields back).
The Routing.pm and API.pm module offer an HTTP interface of this form: POST /api/v3/product_services
The POST body is a JSON object with those fields:
An array list of services to perform.
Currently implemented services:
- echo : does nothing, mostly for testing - estimate_ingredients_percent : compute percent_min, percent_max, percent_estimate for each ingredient in the ingredients object
A product object
An array list of fields to return. If empty, only fields that can be created or updated by the service are returned. e.g. a service to parse the ingredients text list will return the "ingredients" object.
The response is in the JSON API v3 response format, with a resulting product object.
Echo service that returns the input product unchanged.
Process API v3 product services requests.