Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add object titles def to improve SDK generation #10902

Merged
merged 9 commits into from
Oct 17, 2024

Conversation

shinjigi
Copy link
Contributor

@shinjigi shinjigi commented Oct 15, 2024

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] (GH). The changes include:

  • Fixes for conversion errors
  • Updates to dependencies
  • Improvements to the structure of the generated code

Screenshot

image

Related issue(s) and discussion

Additional Notes

Thank you for your cooperation!

- Removed unnecessary nested structure.
- Directly referenced `product.yaml` schema for the `product` property.
…gen recognition in nutrients.yaml

- Add schema ref.
- Add `type: object` to specify the schema type.
- Ensured proper structure and readability.
- Add title for better SDK generation
- ref update on dependent file
-  schema, style and explode are attribute for parameters, not for obj properties.
- Corrected the definition of the `brands`, `labels`, `categories` properties to be an array of strings.
- Completed the definition of the `labels` property.
- Ensure conformity with OpenAPI 3.1 specification.
- Support better the self reference (SDK client gen compliant).
- Add descriptions for all properties.
- Ensure all types are correct and conform to OpenAPI 3.1 specification.
Added title fields to multiple schema files in the OpenAPI definition. These titles will be used to generate class names in the client libraries.

- Added `title` fields to the following schemas:
  - image.yaml
  - image_size.yaml
  - knowledge_panels/elements/table_element.yaml
  - product_attribute_groups.yaml
  - product_ecoscore.yaml
  - product_extended.yaml
  - product_images.yaml
  - product_meta.yaml
  - product_misc.yaml
  - product_nutrition.yaml

The `title` field is used to generate class names in client libraries. For more details, see [OpenAPI Generator Customization](https://openapi-generator.tech/docs/customization/#inline-schema-naming).
@shinjigi shinjigi requested a review from a team as a code owner October 15, 2024 10:12
@github-actions github-actions bot added 📚 Documentation Documentation issues improve the project for everyone. 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels labels Oct 15, 2024
Copy link

@shinjigi shinjigi changed the title Docs api def add titles docs: add object titles def to improve SDK generation Oct 15, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.07%. Comparing base (dc04d18) to head (f06bba8).
Report is 701 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10902      +/-   ##
==========================================
- Coverage   49.54%   49.07%   -0.48%     
==========================================
  Files          67       77      +10     
  Lines       20650    22179    +1529     
  Branches     4980     5303     +323     
==========================================
+ Hits        10231    10884     +653     
- Misses       9131     9963     +832     
- Partials     1288     1332      +44     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@stephanegigandet stephanegigandet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@stephanegigandet stephanegigandet merged commit d605b47 into openfoodfacts:main Oct 17, 2024
14 of 16 checks passed
@shinjigi shinjigi deleted the docs-api-def-add-titles branch October 22, 2024 09:11
@shinjigi shinjigi restored the docs-api-def-add-titles branch November 12, 2024 15:08
@shinjigi shinjigi deleted the docs-api-def-add-titles branch November 12, 2024 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 Documentation Documentation issues improve the project for everyone. 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants