From d605b4712288f9107370dca7d7059c47da4f1717 Mon Sep 17 00:00:00 2001 From: Shinjigi Date: Thu, 17 Oct 2024 14:41:32 +0200 Subject: [PATCH] docs: add object titles def to improve SDK generation (#10902) ### What This pull request addresses errors encountered during the conversion to TypeScript client for the `api.yml` file and its dependencies using [@openapitools/openapi-generator-cli@7.9.0](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](https://github.com/openfoodfacts/openfoodfacts-server/issues/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! --- docs/api/ref/schemas/image.yaml | 2 ++ docs/api/ref/schemas/image_size.yaml | 1 + .../ref/schemas/knowledge_panels/elements/table_element.yaml | 1 + docs/api/ref/schemas/product_attribute_groups.yaml | 1 + docs/api/ref/schemas/product_ecoscore.yaml | 4 ++++ docs/api/ref/schemas/product_extended.yaml | 1 + docs/api/ref/schemas/product_images.yaml | 3 +++ docs/api/ref/schemas/product_meta.yaml | 2 ++ docs/api/ref/schemas/product_misc.yaml | 1 + docs/api/ref/schemas/product_nutrition.yaml | 1 + 10 files changed, 17 insertions(+) diff --git a/docs/api/ref/schemas/image.yaml b/docs/api/ref/schemas/image.yaml index ecf222b5790bd..395b407631943 100644 --- a/docs/api/ref/schemas/image.yaml +++ b/docs/api/ref/schemas/image.yaml @@ -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). diff --git a/docs/api/ref/schemas/image_size.yaml b/docs/api/ref/schemas/image_size.yaml index 58076d8df8084..2f229abcf2e90 100644 --- a/docs/api/ref/schemas/image_size.yaml +++ b/docs/api/ref/schemas/image_size.yaml @@ -1,4 +1,5 @@ type: object +title: image_size properties: h: type: integer diff --git a/docs/api/ref/schemas/knowledge_panels/elements/table_element.yaml b/docs/api/ref/schemas/knowledge_panels/elements/table_element.yaml index c408d4e331b2f..90f0f185a3735 100644 --- a/docs/api/ref/schemas/knowledge_panels/elements/table_element.yaml +++ b/docs/api/ref/schemas/knowledge_panels/elements/table_element.yaml @@ -17,6 +17,7 @@ properties: type: array items: type: object + title: table_column properties: type: type: string diff --git a/docs/api/ref/schemas/product_attribute_groups.yaml b/docs/api/ref/schemas/product_attribute_groups.yaml index c67814befaac5..920466272f6c6 100644 --- a/docs/api/ref/schemas/product_attribute_groups.yaml +++ b/docs/api/ref/schemas/product_attribute_groups.yaml @@ -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: diff --git a/docs/api/ref/schemas/product_ecoscore.yaml b/docs/api/ref/schemas/product_ecoscore.yaml index 1a01da86c8a68..9d9971900d4d3 100644 --- a/docs/api/ref/schemas/product_ecoscore.yaml +++ b/docs/api/ref/schemas/product_ecoscore.yaml @@ -1,4 +1,5 @@ type: object +title: product_ecoscore description: | Fields related to Eco-Score for a product. @@ -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. @@ -20,6 +22,7 @@ properties: aggregated_origins: type: array items: + title: adjustments_origin_of_ingredient_aggregated type: object properties: origin: @@ -74,6 +77,7 @@ properties: type: array items: type: object + title: adjustments_packaging_item properties: ecoscore_material_score: type: integer diff --git a/docs/api/ref/schemas/product_extended.yaml b/docs/api/ref/schemas/product_extended.yaml index b317ac606d2f5..b851737fa319e 100644 --- a/docs/api/ref/schemas/product_extended.yaml +++ b/docs/api/ref/schemas/product_extended.yaml @@ -1,3 +1,4 @@ +title: product_extended type: object properties: additives_original_tags: diff --git a/docs/api/ref/schemas/product_images.yaml b/docs/api/ref/schemas/product_images.yaml index 22d8ef556ad0f..8f7d85d2ddf8b 100644 --- a/docs/api/ref/schemas/product_images.yaml +++ b/docs/api/ref/schemas/product_images.yaml @@ -1,4 +1,5 @@ type: object +title: product_images description: | Information about Images of a product. @@ -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 @@ -47,6 +49,7 @@ properties: selected_images: type: object + title: product_selected_images description: | URL for selected (important) images of the product. diff --git a/docs/api/ref/schemas/product_meta.yaml b/docs/api/ref/schemas/product_meta.yaml index 6ff9c0d05e8db..bac35a6fd3451 100644 --- a/docs/api/ref/schemas/product_meta.yaml +++ b/docs/api/ref/schemas/product_meta.yaml @@ -86,6 +86,7 @@ properties: type: array items: type: object + title: product_meta_source properties: fields: type: array @@ -115,6 +116,7 @@ properties: - string sources_fields: type: object + title: product_meta_source_fields properties: org-gs1: type: object diff --git a/docs/api/ref/schemas/product_misc.yaml b/docs/api/ref/schemas/product_misc.yaml index 05ce5b58a9a16..7b16cb9b15a6d 100644 --- a/docs/api/ref/schemas/product_misc.yaml +++ b/docs/api/ref/schemas/product_misc.yaml @@ -1,4 +1,5 @@ type: object +title: product_misc description: | Miscellaneous but important fields of a product properties: diff --git a/docs/api/ref/schemas/product_nutrition.yaml b/docs/api/ref/schemas/product_nutrition.yaml index 3b22bfbc74366..d0a58bbac3e78 100644 --- a/docs/api/ref/schemas/product_nutrition.yaml +++ b/docs/api/ref/schemas/product_nutrition.yaml @@ -1,4 +1,5 @@ type: object +title: product_nutrition description: | Nutrition fields of a product