Skip to content

Commit

Permalink
docs: add object titles def to improve SDK generation (#10902)
Browse files Browse the repository at this point in the history
<!-- IMPORTANT CHECKLIST
Make sure you've done all the following (You can delete the checklist
before submitting)
- [X] PR title is prefixed by one of the following: feat, fix, docs,
style, refactor, test, build, ci, chore, revert, l10n, taxonomy
- [ ] Code is well documented
- [ ] Include unit tests for new functionality
- [X] Code passes GitHub workflow checks in your branch
- [X] If you have multiple commits please combine them into one commit
by squashing them.
- [X] Read and understood the [contribution
guidelines](https://github.com/openfoodfacts/openfoodfacts-server/blob/main/CONTRIBUTING.md)
-->

### What
This pull request addresses errors encountered during the conversion to
TypeScript client for the `api.yml` file and its dependencies using
[@openapitools/[email protected]](https://openapi-generator.tech/docs/generators/typescript-fetch)
([GH](https://github.com/OpenAPITools/openapi-generator/tree/master?tab=readme-ov-file#2---getting-started)).
The changes include:
- Fixes for conversion errors
- Updates to dependencies
- Improvements to the structure of the generated code

### Screenshot

![image](https://github.com/user-attachments/assets/e7ee8538-4545-4a31-aed5-740a4e88c936)

### Related issue(s) and discussion
- Fixes
#[9419](#9419)

### Additional Notes
- More info:
[https://openapi-generator.tech/docs/customization/#inline-schema-naming](https://openapi-generator.tech/docs/customization/#inline-schema-naming)
- Please review the changes and provide feedback. If there are any
additional modifications needed, let me know.

Thank you for your cooperation!
  • Loading branch information
shinjigi authored Oct 17, 2024
1 parent 7519987 commit d605b47
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/api/ref/schemas/image.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
type: object
title: image
description: |
This object represent an image that was uploaded to a product.
"imgid" is an integer which is a sequential number unique to each picture.
properties:
sizes:
title: image_sizes
type: object
description: |
The available image sizes for the product (both reduced and full).
Expand Down
1 change: 1 addition & 0 deletions docs/api/ref/schemas/image_size.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
type: object
title: image_size
properties:
h:
type: integer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ properties:
type: array
items:
type: object
title: table_column
properties:
type:
type: string
Expand Down
1 change: 1 addition & 0 deletions docs/api/ref/schemas/product_attribute_groups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ properties:
type: array
description: Each element is an attribute that can help compute a personal ranking for the product
items:
title: product_attribute_group
type: object
properties:
id:
Expand Down
4 changes: 4 additions & 0 deletions docs/api/ref/schemas/product_ecoscore.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
type: object
title: product_ecoscore
description: |
Fields related to Eco-Score for a product.
Expand All @@ -7,6 +8,7 @@ description: |
properties:
ecoscore_data:
type: object
title: ecoscore_data
description: |
An object about a lot of details about data needed for Eco-Score computation
and complementary data of interest.
Expand All @@ -20,6 +22,7 @@ properties:
aggregated_origins:
type: array
items:
title: adjustments_origin_of_ingredient_aggregated
type: object
properties:
origin:
Expand Down Expand Up @@ -74,6 +77,7 @@ properties:
type: array
items:
type: object
title: adjustments_packaging_item
properties:
ecoscore_material_score:
type: integer
Expand Down
1 change: 1 addition & 0 deletions docs/api/ref/schemas/product_extended.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
title: product_extended
type: object
properties:
additives_original_tags:
Expand Down
3 changes: 3 additions & 0 deletions docs/api/ref/schemas/product_images.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
type: object
title: product_images
description: |
Information about Images of a product.
Expand All @@ -14,6 +15,7 @@ properties:
description: |
This contains properties for all images contained on the product.
type: object
title: product_images
properties:
1:
type: object
Expand Down Expand Up @@ -47,6 +49,7 @@ properties:

selected_images:
type: object
title: product_selected_images
description: |
URL for selected (important) images of the product.
Expand Down
2 changes: 2 additions & 0 deletions docs/api/ref/schemas/product_meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ properties:
type: array
items:
type: object
title: product_meta_source
properties:
fields:
type: array
Expand Down Expand Up @@ -115,6 +116,7 @@ properties:
- string
sources_fields:
type: object
title: product_meta_source_fields
properties:
org-gs1:
type: object
Expand Down
1 change: 1 addition & 0 deletions docs/api/ref/schemas/product_misc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
type: object
title: product_misc
description: |
Miscellaneous but important fields of a product
properties:
Expand Down
1 change: 1 addition & 0 deletions docs/api/ref/schemas/product_nutrition.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
type: object
title: product_nutrition
description: |
Nutrition fields of a product
Expand Down

0 comments on commit d605b47

Please sign in to comment.