Skip to content

Commit

Permalink
docs: fix OpenAPI Product schema file, extract agribalyze.yaml (#8450)
Browse files Browse the repository at this point in the history
* docs: fix OpenAPI `Product` schema file

* fix: typo in agribalise
  • Loading branch information
VaiTon committed May 25, 2023
1 parent 7953dbc commit f970234
Show file tree
Hide file tree
Showing 4 changed files with 2,048 additions and 2,046 deletions.
11 changes: 5 additions & 6 deletions docs/api/ref/requestBodies/crop_a_photo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ properties:
code:
type: string
description: Barcode of the product.
example: '04963406'
example: "04963406"
required: true
imgid:
type: integer
description: identifier of the image to select, it should be a number
example: 2
required: true
id:
type: string
description: |
Expand All @@ -23,6 +25,7 @@ properties:
displayed on Product Opener for all languages (ex: on
`https://fr.openfoodfacts.org`, unless `ingredients_fr` exists).
example: front_en
required: true
x1:
type: integer
example: 0
Expand Down Expand Up @@ -60,8 +63,4 @@ properties:
ImageMagick.
enum:
- "true"
- "false"
required:
- code
- imgid
- id
- "false"
2 changes: 1 addition & 1 deletion docs/api/ref/responses/get_product_by_barcode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ allOf:
product:
type: object
allOf:
- $ref: ../schemas/product.yaml#/Product
- $ref: ../schemas/product.yaml
x-examples:
example-1:
code: '3017620422003'
Expand Down
47 changes: 47 additions & 0 deletions docs/api/ref/schemas/agribalyse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
type: object
properties:
agribalyse_food_code:
type: string
co2_agriculture:
type: number
co2_consumption:
type: integer
co2_distribution:
type: number
co2_packaging:
type: number
co2_processing:
type: number
co2_total:
type: number
co2_transportation:
type: number
code:
type: string
dqr:
type: string
ef_agriculture:
type: number
ef_consumption:
type: integer
ef_distribution:
type: number
ef_packaging:
type: number
ef_processing:
type: number
ef_total:
type: number
ef_transportation:
type: number
is_beverage:
type: integer
name_en:
type: string
description: |
This can be returned in many other languages
like name_fr (for french).
score:
type: integer
version:
type: string
Loading

0 comments on commit f970234

Please sign in to comment.