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

OpenAPISpec is not a valid 3.1.0 openAPI-Spec #8039

Open
sgtSeme4ki opened this issue Jan 26, 2023 · 2 comments
Open

OpenAPISpec is not a valid 3.1.0 openAPI-Spec #8039

sgtSeme4ki opened this issue Jan 26, 2023 · 2 comments
Labels
API Refactor OpenAPI OpenAPI documentation of Open Food Facts. Still incomplete, and needs help. 🎯 P1 ✅ Task

Comments

@sgtSeme4ki
Copy link
Contributor

sgtSeme4ki commented Jan 26, 2023

What

  • When trying to validate the api.yml via the openApiValidator it shows multiple issues that are making the api.yml invalid.
  • This can be an issue if you are e. g. trying to generate client-code for openfoodfacts-server.

Part of

@sgtSeme4ki
Copy link
Contributor Author

sgtSeme4ki commented Jan 26, 2023

#8042

@alexgarel
Copy link
Member

There was a tentative but for now it's broken. See:
See #8042 (comment)

@teolemon teolemon added the OpenAPI OpenAPI documentation of Open Food Facts. Still incomplete, and needs help. label Nov 13, 2023
stephanegigandet pushed a commit that referenced this issue Oct 21, 2024
feat(api): improve OpenAPI schema consistency and structure

### What
This pull request enhances the consistency and structure of OpenAPI
schemas in the Open Food Facts project. The main changes include:

- Added missing titles to response and request schemas for better
identification
- Standardized schema references using #/components/schemas/ for
improved consistency
- Removed unnecessary x-stoplight metadata
- Fixed inconsistencies in data types and enums
- Improved descriptions and examples in various schemas
- Restructured the image_role schema for better organization
- Updated the product schema to use centralized component references

These changes improve the readability, maintainability, and consistency
of the API definition, making it easier for developers to use and
integrate.

The updated schema has been tested with the following OpenAPI generators
and tools:

- OpenAPI Generator:
  - typescript-fetch
  - typescript
  - javascript
- @hey-api/openapi-ts
- Swagger Editor (editor-next.swagger.io)

The primary configuration used for testing was:

```yaml
generatorName: typescript-fetch
outputDir: ./clients/ts-fetch
inputSpec: ./fork-shinjigi-4pullrequest-api-ref/api.yml
verbose: false
additionalProperties:
  npmName: "@iside/ec-open-food-facts-client-ts-fetch"
  npmVersion: "1.122.0"
  npmRepository: "http://"
  snapshot: false
  supportsES6: false
  modelPropertyNaming: "original"
  enumPropertyNaming: "original"
  paramNaming: "original"
enablePostProcessFile: true
modelNameMappings:
  ingredient_1: Ingredient
  product_extended_owner_fields_1: ProductExtendedOwnerFields
  product_extended_owner_fields_1_additionalProperties: ProductExtendedOwnerFieldsAdditionalProperties
  product_ecoscore_data_1: ProductEcoscoreData
globalProperties:
  debugOpenAPI: true
```

### Screenshot

![graph](https://github.com/user-attachments/assets/05da6b7c-ad85-4217-bbf3-57339fd6d883)


https://github.com/user-attachments/assets/61f50394-8992-4b8e-bd9c-76c8c138390a



### Related issue(s) and discussion
- Fixes/RelatedTo:
#8039 
#8042
stephanegigandet pushed a commit that referenced this issue Oct 24, 2024
…ty to solve openapi linter errors/warnings (#10922)

<!-- 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
- [x] Code is well documented
- [x] 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 request was born from the desire to fix some validation errors
raised by the most common SDK client generators (openapi, swagger,
redocly). The pull request unifies the 2 definitions of `get by barcode`
and adds `security schemes` and authentication endpoints to the Open
Food Facts API.

- Added security schemes for `cookieAuth` and `userAgentAuth`.
- Added security definitions to existing endpoints.
- Introduced new endpoint `/cgi/session.pl` for login and obtaining a
session cookie.
- Updated components with new schema `AppCredentials`.
- Added security section to specify no authentication required by
default for read requests.
- Updated tags to include `Authentication` for endpoints related to
authentication.
- Unified `get by barcode` and removed path with query string to solve
Redocly and Swagger validation error: "Problem: Don't put query string
items in the path, they belong in parameters with `in: query`."

### Screenshot
```
> @food-alpha/[email protected] build:tsfetch ~/projects/food-alpha/packages/off-clients
> cd ./clients/ts-fetch && pnpm install && pnpm run build

Scope: all 4 workspace projects
../../../pwa                     |  WARN  deprecated [email protected]
 WARN  5 deprecated subdependencies found: @humanwhocodes/[email protected], @humanwhocodes/[email protected], [email protected], [email protected], [email protected]
../../../..                              |   +1 +
../../../..                              | Progress: resolved 1233, reused 1186, downloaded 0, added 1, done
. prepare$ pnpm run build
│ > @food-alpha/[email protected] build ~/projects/food-alpha/packages/off-clients…
│ > tsc
└─ Done in 2.3s
Done in 19.2s

> @food-alpha/[email protected] build ~/projects/food-alpha/packages/off-clients/clients/ts-fetch
> tsc


> @food-alpha/[email protected] gen:api ~/projects/food-alpha/packages/off-clients
> java -jar ../../../../_GH/_java/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i ./fork-shinjigi-4pullrequest-api-ref/api.yml -g openapi-yaml -o openapi/

[main] WARN  o.o.codegen.DefaultCodegen - Generation using 3.1.0 specs is in development and is not officially supported yet. If you would like to expedite development, please consider working on the open issues in the 3.1.0 project: https://github.com/orgs/OpenAPITools/projects/4/views/1 and reach out to our team on Slack at https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g
[main] INFO  o.o.codegen.DefaultGenerator - Generating with dryRun=false
[main] INFO  o.o.codegen.DefaultGenerator - OpenAPI Generator: openapi-yaml (documentation)
[main] INFO  o.o.codegen.DefaultGenerator - Generator 'openapi-yaml' is considered stable.
[main] INFO  o.o.c.languages.OpenAPIYamlGenerator - Output file [outputFile=openapi/openapi.yaml]
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_misc_nutrient_levels. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_misc_nutrient_levels=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_misc_nutrient_levels=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as Packaging_component_shape. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings Packaging_component_shape=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings Packaging_component_shape=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as Packaging_component_material. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings Packaging_component_material=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings Packaging_component_material=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as Packaging_component_recycling_instruction. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings Packaging_component_recycling_instruction=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings Packaging_component_recycling_instruction=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as Packaging_component__READ_. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings Packaging_component__READ_=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings Packaging_component__READ_=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as image_sizes. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings image_sizes=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings image_sizes=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as image_role_sizes. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings image_role_sizes=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings image_role_sizes=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_selected_images_front. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_selected_images_front=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_selected_images_front=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_ecoscore_data_adjustments_origins_of_ingredients_transportation_scores. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_ecoscore_data_adjustments_origins_of_ingredients_transportation_scores=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_ecoscore_data_adjustments_origins_of_ingredients_transportation_scores=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_ecoscore_data_adjustments_origins_of_ingredients. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_ecoscore_data_adjustments_origins_of_ingredients=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_ecoscore_data_adjustments_origins_of_ingredients=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_ecoscore_data_adjustments_packaging. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_ecoscore_data_adjustments_packaging=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_ecoscore_data_adjustments_packaging=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_ecoscore_data_adjustments_production_system. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_ecoscore_data_adjustments_production_system=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_ecoscore_data_adjustments_production_system=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_ecoscore_data_adjustments_threatened_species. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_ecoscore_data_adjustments_threatened_species=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_ecoscore_data_adjustments_threatened_species=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_ecoscore_data_adjustments. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_ecoscore_data_adjustments=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_ecoscore_data_adjustments=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_ecoscore_data_agribalyse. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_ecoscore_data_agribalyse=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_ecoscore_data_agribalyse=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_ecoscore_data_missing. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_ecoscore_data_missing=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_ecoscore_data_missing=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_ecoscore_data_previous_data. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_ecoscore_data_previous_data=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_ecoscore_data_previous_data=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as ingredient_percent_max. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings ingredient_percent_max=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings ingredient_percent_max=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_ingredients_ingredients_analysis. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_ingredients_ingredients_analysis=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_ingredients_ingredients_analysis=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_ingredients_traces_hierarchy_inner. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_ingredients_traces_hierarchy_inner=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_ingredients_traces_hierarchy_inner=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_nutrition_nutriments. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_nutrition_nutriments=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_nutrition_nutriments=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_nutrition_nutriscore_data. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_nutrition_nutriscore_data=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_nutrition_nutriscore_data=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_extended_categories_properties. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_extended_categories_properties=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_extended_categories_properties=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_extended_owner_fields_additionalProperties. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_extended_owner_fields_additionalProperties=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_extended_owner_fields_additionalProperties=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_extended_owner_fields. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_extended_owner_fields=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_extended_owner_fields=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_extended_nova_groups_markers. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_extended_nova_groups_markers=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_extended_nova_groups_markers=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_meta_source_manufacturer. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_meta_source_manufacturer=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_meta_source_manufacturer=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_meta_source_fields_org_gs1. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_meta_source_fields_org_gs1=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_meta_source_fields_org_gs1=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as get_cgi_product_image_upload_pl_request. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings get_cgi_product_image_upload_pl_request=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings get_cgi_product_image_upload_pl_request=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as add_photo_to_existing_product_response_files_inner. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings add_photo_to_existing_product_response_files_inner=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings add_photo_to_existing_product_response_files_inner=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as add_photo_to_existing_product_response_image. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings add_photo_to_existing_product_response_image=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings add_photo_to_existing_product_response_image=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as rotate_a_photo_response_image. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings rotate_a_photo_response_image=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings rotate_a_photo_response_image=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as post_cgi_product_image_crop_pl_request. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings post_cgi_product_image_crop_pl_request=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings post_cgi_product_image_crop_pl_request=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as post_cgi_product_jqm2_pl_request. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings post_cgi_product_jqm2_pl_request=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings post_cgi_product_jqm2_pl_request=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as get_preferences_200_response_inner. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings get_preferences_200_response_inner=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings get_preferences_200_response_inner=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as get_cgi_session_pl_request. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings get_cgi_session_pl_request=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings get_cgi_session_pl_request=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_selected_images_1_front_display. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_selected_images_1_front_display=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_selected_images_1_front_display=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_selected_images_1_front_small. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_selected_images_1_front_small=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_selected_images_1_front_small=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_selected_images_1_front_thumb. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_selected_images_1_front_thumb=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_selected_images_1_front_thumb=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_selected_images_1_front. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_selected_images_1_front=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_selected_images_1_front=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_selected_images_1. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_selected_images_1=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_selected_images_1=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_ecoscore_data_1_grades. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_ecoscore_data_1_grades=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_ecoscore_data_1_grades=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_ecoscore_data_1. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_ecoscore_data_1=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_ecoscore_data_1=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_ingredients_percent_max. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_ingredients_percent_max=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_ingredients_percent_max=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as ingredient_1. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings ingredient_1=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings ingredient_1=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_ingredients_traces_hierarchy. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_ingredients_traces_hierarchy=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_ingredients_traces_hierarchy=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_ingredients_traces_tags. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_ingredients_traces_tags=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_ingredients_traces_tags=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_extended_owner_fields_1_additionalProperties. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_extended_owner_fields_1_additionalProperties=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_extended_owner_fields_1_additionalProperties=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_extended_owner_fields_1. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_extended_owner_fields_1=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_extended_owner_fields_1=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as Product_allOf_languages_codes. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings Product_allOf_languages_codes=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings Product_allOf_languages_codes=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as Product_allOf_manufacturer. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings Product_allOf_manufacturer=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings Product_allOf_manufacturer=NewModel,ModelA=NewModelA in CLI).
[main] INFO  o.o.codegen.InlineModelResolver - Inline schema created as product_meta_source_1. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings product_meta_source_1=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings product_meta_source_1=NewModel,ModelA=NewModelA in CLI).
[main] WARN  o.o.codegen.DefaultCodegen - Generation using 3.1.0 specs is in development and is not officially supported yet. If you would like to expedite development, please consider working on the open issues in the 3.1.0 project: https://github.com/orgs/OpenAPITools/projects/4/views/1 and reach out to our team on Slack at https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g
[main] INFO  o.o.codegen.DefaultGenerator - Model get_cgi_product_image_upload_pl_request not generated since it's marked as unused (due to form parameters) and `skipFormModel` (global property) set to true (default)
[main] INFO  o.o.codegen.DefaultGenerator - Model post_cgi_product_image_crop_pl_request not generated since it's marked as unused (due to form parameters) and `skipFormModel` (global property) set to true (default)
[main] INFO  o.o.codegen.DefaultGenerator - Model unselect_a_photo_request not generated since it's marked as unused (due to form parameters) and `skipFormModel` (global property) set to true (default)
[main] INFO  o.o.codegen.DefaultGenerator - Model post_cgi_product_jqm2_pl_request not generated since it's marked as unused (due to form parameters) and `skipFormModel` (global property) set to true (default)
[main] INFO  o.o.codegen.DefaultGenerator - Model get_cgi_session_pl_request not generated since it's marked as unused (due to form parameters) and `skipFormModel` (global property) set to true (default)
[main] INFO  o.o.codegen.DefaultGenerator - Model product_selected_images_1_front_display not generated since it's a free-form object
[main] INFO  o.o.codegen.DefaultGenerator - Model product_selected_images_1_front_small not generated since it's a free-form object
[main] INFO  o.o.codegen.DefaultGenerator - Model product_selected_images_1_front_thumb not generated since it's a free-form object
[main] INFO  o.o.codegen.DefaultGenerator - Model product_ecoscore_data_1_grades not generated since it's a free-form object
[main] INFO  o.o.codegen.DefaultGenerator - Model Product_allOf_languages_codes not generated since it's a free-form object
[main] WARN  o.o.codegen.DefaultCodegen - Could not compute datatypeWithEnum from string, null
[main] WARN  o.o.codegen.DefaultCodegen - Could not compute datatypeWithEnum from string, null
[main] WARN  o.o.codegen.DefaultCodegen - Could not compute datatypeWithEnum from string, null
[main] INFO  o.o.codegen.TemplateManager - writing file ~/projects/food-alpha/packages/off-clients/openapi/README.md
[main] INFO  o.o.codegen.TemplateManager - writing file ~/projects/food-alpha/packages/off-clients/openapi/openapi/openapi.yaml
[main] INFO  o.o.codegen.TemplateManager - Skipped ~/projects/food-alpha/packages/off-clients/openapi/.openapi-generator-ignore (Skipped by supportingFiles options supplied by user.)
[main] INFO  o.o.codegen.TemplateManager - writing file ~/projects/food-alpha/packages/off-clients/openapi/.openapi-generator/VERSION
[main] INFO  o.o.codegen.TemplateManager - writing file ~/projects/food-alpha/packages/off-clients/openapi/.openapi-generator/FILES
################################################################################
# Thanks for using OpenAPI Generator.                                          #
# Please consider donation to help us maintain this project 🙏                 #
# https://opencollective.com/openapi_generator/donate                          #
################################################################################

> @food-alpha/[email protected] redocly:lint ~/projects/food-alpha/packages/off-clients
> npx @redocly/cli@latest lint  off@v1

validating ./fork-shinjigi-4pullrequest-api-ref/api.yml...
./fork-shinjigi-4pullrequest-api-ref/api.yml: validated in 100ms

Woohoo! Your API description is valid. 🎉


> @food-alpha/[email protected] redocly ~/projects/food-alpha/packages/off-clients
> npx @redocly/cli@latest build-docs ./fork-shinjigi-4pullrequest-api-ref/api.yml --output ./clients/redocly/redocly.html

Found redocly.yaml and using theme.openapi options
Prerendering docs

🎉 bundled successfully in: ./clients/redocly/redocly.html (701 KiB) [⏱ 2ms].
```

### Related issue(s) and discussion
<!-- Please add the issue number this issue will close, that way, once
your pull request is merged, the issue will be closed as well -->
- Related to:
#7446 
#9419 
#8039
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Refactor OpenAPI OpenAPI documentation of Open Food Facts. Still incomplete, and needs help. 🎯 P1 ✅ Task
Projects
Status: To discuss and validate
Status: To be triaged
Development

No branches or pull requests

3 participants