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

feat: api docs remove query string from get by barcode and add security to solve openapi linter errors/warnings #10922

Conversation

shinjigi
Copy link
Contributor

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

+ add type on obj to remove redocly linter error
+ TODO on image_role normalize and white_magic fields
+ uniform quotes
…ror.

+ Ingredient reference to fix generator referencing error.
…redocly and swagger validation error: "Problem: Don't put query string items in the path, they belong in parameters with `in: query`."
- 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.
@shinjigi shinjigi requested a review from a team as a code owner October 22, 2024 09:58
@github-actions github-actions bot added ✏️ Editing 📚 Documentation Documentation issues improve the project for everyone. API WRITE WRITE API to allow sending product info and image labels Oct 22, 2024
@shinjigi shinjigi changed the title Feat: api docs remove query string from get by barcode and add security to solve openapi linter errors/warnings feat: api docs remove query string from get by barcode and add security to solve openapi linter errors/warnings Oct 22, 2024
@codecov-commenter
Copy link

codecov-commenter commented Oct 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.03%. Comparing base (dc04d18) to head (ecd466d).
Report is 719 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10922      +/-   ##
==========================================
- Coverage   49.54%   49.03%   -0.51%     
==========================================
  Files          67       77      +10     
  Lines       20650    22229    +1579     
  Branches     4980     5313     +333     
==========================================
+ Hits        10231    10901     +670     
- Misses       9131     9994     +863     
- Partials     1288     1334      +46     

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

Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

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

Thanks a lot @shinjigi

I just have a small point on order of parameters in cookie !

docs/api/ref/api.yml Show resolved Hide resolved
docs/api/ref/api.yml Show resolved Hide resolved
docs/api/ref/api.yml Show resolved Hide resolved
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!

Copy link

sonarcloud bot commented Oct 24, 2024

@stephanegigandet stephanegigandet merged commit b7aefbd into openfoodfacts:main Oct 24, 2024
13 checks passed
stephanegigandet pushed a commit that referenced this pull request Oct 24, 2024
🤖 I have created a release *beep* *boop*
---


##
[2.47.0](v2.46.0...v2.47.0)
(2024-10-24)


### Features

* api docs remove query string from get by barcode and add security to
solve openapi linter errors/warnings
([#10922](#10922))
([b7aefbd](b7aefbd))
* Eco-Score improvements and change of scale: A+ to F
([#10829](#10829))
([87df665](87df665))


### Bug Fixes

* add googleOther bot
([#10912](#10912))
([d56760a](d56760a))
* allow CORS requests for product image move
([#10920](#10920))
([967a47e](967a47e))
* attribute for product without new nutriscore data
([#10915](#10915))
([c413719](c413719))
* cosmetic changes for new Eco-Score grades
([#10921](#10921))
([6e7dbfa](6e7dbfa))
* Revert "fix: remove unused jquery-ui safe-active-element module
([#10708](#10708))"
([#10924](#10924))
([d290c54](d290c54))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API WRITE WRITE API to allow sending product info and image 📚 Documentation Documentation issues improve the project for everyone. ✏️ Editing
Development

Successfully merging this pull request may close these issues.

4 participants