Skip to content

Commit

Permalink
docs: Add more body parameters to Edit A Product (#7776)
Browse files Browse the repository at this point in the history
  • Loading branch information
Roxie-32 authored Dec 12, 2022
1 parent f23c75b commit 7b39820
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 3 deletions.
12 changes: 11 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ knowledge-panels:
- templates/api/knowledge-panels/health/nutrition/nutrition_facts_table.tt.json
- tests/integration/expected_test_results/api_v3_product_read/get-knowledge-panels.json
- tests/integration/expected_test_results/api_v3_product_read/get-knowledge-panels-fr.json
- docs/reference/schemas/knowledge_panels/**

serving size:
- templates/api/knowledge-panels/health/nutrition/serving_size.tt.json
Expand Down Expand Up @@ -426,6 +427,7 @@ Packaging:
- templates/api/knowledge-panels/environment/packaging_recycling.tt.json
- templates/api/knowledge-panels/environment/ecoscore/packaging.tt.json
- tests/unit/packaging.t
- docs/reference/schemas/packagings/**

producers platform:
- lib/ProductOpener/GS1.pm
Expand Down Expand Up @@ -473,6 +475,8 @@ images:
- cgi/product_image_unselect.pl
- cgi/product_image_upload.pl
- scripts/delete_old_cropped_images.pl
- docs/reference/requestBodies/crop_a_photo.yaml
- docs/reference/requestBodies/add_photo_to_existing_product.yaml

Products:
- lib/ProductOpener/Products.pm
Expand Down Expand Up @@ -508,6 +512,7 @@ editing:
- templates/web/pages/product_edit/display_input_tabs.tt.html
- templates/web/pages/product_edit/product_edit_form_display.tt.html
- templates/web/pages/product_edit/product_edit_form_process.tt.html
- docs/reference/requestBodies/add_or_edit_a_product.yaml

Product page:
- templates/web/pages/product/includes/edit_history.tt.html
Expand Down Expand Up @@ -723,6 +728,8 @@ API:
- docs/reference/api-v3.yml
- lib/ProductOpener/API.pm
- tests/integration/api_v2_product_read.t
- docs/reference/requestBodies/lc_cc.yaml
- docs/reference/requestBodies/fields_tags_lc.yaml

API v3:
- docs/reference/api-v3.yml
Expand All @@ -734,7 +741,10 @@ API read:

API write:
- tests/integration/api_v3_product_write.t

- docs/reference/requestBodies/add_or_edit_a_product.yaml
- docs/reference/requestBodies/crop_a_photo.yaml
- docs/reference/requestBodies/add_photo_to_existing_product.yaml

monitoring:
- scripts/api_stats.pl

Expand Down
5 changes: 3 additions & 2 deletions docs/reference/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,9 @@ paths:
tags:
- Write Requests
description: |
If a barcode exists then you will be editing a product,
However if it doesn''t you qill be creating a new product with that unique barcode.
If the barcode exists then you will be editing the existing product,
However if it doesn''t you will be creating a new product with that unique barcode,
and adding properties to the product.
/api/v2/search:
get:
summary: Search for Products
Expand Down
34 changes: 34 additions & 0 deletions docs/reference/requestBodies/add_or_edit_a_product.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,40 @@ properties:
type: string
description: A valid corresponding password.
example: mypassword
brands:
schema:
type: array
items:
type: string
style: form
explode: false
description: The brands of the product (comma separated list of values).
example: Häagen-Dazs,General-mills
labels:
schema:
type: array
items:
type: string
style: form
explode: false
description: The labels of the product (comma separated list of values).
example: Kosher,Ferroro
categories:
schema:
type: array
items:
type: string
style: form
explode: false
description: The categories of the product (comma separated list of values).
example: Desserts,Frozen foods
packaging:
type: string
description: |
Packaging type, format, material.
The [v3 API documentation](https://openfoodfacts.github.io/openfoodfacts-server/reference/api-v3/#operation/post-api-v3-product-barcode)
has a more structured data for `packaging`.
example: Frozen
required:
- code
- user_id
Expand Down

0 comments on commit 7b39820

Please sign in to comment.