File: /var/www/matriculas_api_dev/config/l5-swagger.php
<?php
return [
'default' => 'default',
'documentations' => [
// =====================================================================
// Swagger 1: Matrículas API (interno - auth.any / Sanctum / Bearer)
// Ruta: /api/documentation
// =====================================================================
'default' => [
'api' => [
'title' => 'Matrículas API - Documentación Interna',
],
'routes' => [
'api' => 'api/documentation',
],
'paths' => [
'use_absolute_path' => env('L5_SWAGGER_USE_ABSOLUTE_PATH', true),
'swagger_ui_assets_path' => env('L5_SWAGGER_UI_ASSETS_PATH', 'vendor/swagger-api/swagger-ui/dist/'),
'docs_json' => 'api-docs.json',
'docs_yaml' => 'api-docs.yaml',
'format_to_use_for_docs' => env('L5_FORMAT_TO_USE_FOR_DOCS', 'json'),
'annotations' => [
base_path('app'),
],
],
'scanOptions' => [
'exclude' => [
base_path('app/Http/Controllers/Odoo'),
],
],
'securityDefinitions' => [
'securitySchemes' => [
'bearerAuth' => [
'type' => 'http',
'scheme' => 'bearer',
'bearerFormat' => 'JWT',
],
],
'security' => [
[
'bearerAuth' => [],
],
],
],
],
// =====================================================================
// Swagger 2: Odoo API v1 (público - X-Api-Token)
// Ruta: /api/documentation-v1
// =====================================================================
'odoo_v1' => [
'api' => [
'title' => 'Matrículas - Odoo API v1',
],
'routes' => [
'api' => 'api/documentation-odoo',
'docs' => 'docs-v1',
],
'paths' => [
'use_absolute_path' => env('L5_SWAGGER_USE_ABSOLUTE_PATH', true),
'swagger_ui_assets_path' => env('L5_SWAGGER_UI_ASSETS_PATH', 'vendor/swagger-api/swagger-ui/dist/'),
'docs_json' => 'odoo-v1-docs.json',
'docs_yaml' => 'odoo-v1-docs.yaml',
'format_to_use_for_docs' => env('L5_FORMAT_TO_USE_FOR_DOCS', 'json'),
'annotations' => [
base_path('app/Http/Controllers/Odoo'),
],
],
'securityDefinitions' => [
'securitySchemes' => [
'apiV1Token' => [
'type' => 'apiKey',
'name' => 'X-Api-Token',
'in' => 'header',
'description' => 'Token estático para autenticación Opens API v1',
],
],
'security' => [
[
'apiV1Token' => [],
],
],
],
],
],
'defaults' => [
'routes' => [
/*
* Route for accessing parsed swagger annotations.
*/
'docs' => 'docs',
/*
* Route for Oauth2 authentication callback.
*/
'oauth2_callback' => 'api/oauth2-callback',
/*
* Middleware allows to prevent unexpected access to API documentation
*/
'middleware' => [
'api' => [],
'asset' => [],
'docs' => [],
'oauth2_callback' => [],
],
/*
* Route Group options
*/
'group_options' => [],
],
'paths' => [
/*
* Absolute path to location where parsed annotations will be stored
*/
'docs' => storage_path('api-docs'),
/*
* Absolute path to directory where to export views
*/
'views' => base_path('resources/views/vendor/l5-swagger'),
/*
* Edit to set the api's base path
*/
'base' => env('L5_SWAGGER_BASE_PATH', null),
/*
* Absolute path to directories that should be excluded from scanning
* @deprecated Please use `scanOptions.exclude`
* `scanOptions.exclude` overwrites this
*/
'excludes' => [],
],
'scanOptions' => [
'default_processors_configuration' => [],
'analyser' => null,
'analysis' => null,
'processors' => [],
'pattern' => null,
'exclude' => [],
'open_api_spec_version' => env('L5_SWAGGER_OPEN_API_SPEC_VERSION', \L5Swagger\Generator::OPEN_API_DEFAULT_SPEC_VERSION),
],
/*
* API security definitions. Will be generated into documentation file.
* Vacío para que cada documentation defina las suyas sin herencia.
*/
'securityDefinitions' => [
'securitySchemes' => [],
'security' => [],
],
'generate_always' => env('L5_SWAGGER_GENERATE_ALWAYS', false),
'generate_yaml_copy' => env('L5_SWAGGER_GENERATE_YAML_COPY', false),
'proxy' => false,
'additional_config_url' => null,
'operations_sort' => env('L5_SWAGGER_OPERATIONS_SORT', null),
'validator_url' => null,
'ui' => [
'display' => [
'dark_mode' => env('L5_SWAGGER_UI_DARK_MODE', false),
'doc_expansion' => env('L5_SWAGGER_UI_DOC_EXPANSION', 'none'),
'filter' => env('L5_SWAGGER_UI_FILTERS', true),
],
'authorization' => [
'persist_authorization' => env('L5_SWAGGER_UI_PERSIST_AUTHORIZATION', false),
'oauth2' => [
'use_pkce_with_authorization_code_grant' => false,
],
],
],
'constants' => [
'L5_SWAGGER_CONST_HOST' => env('APP_URL', 'http://localhost') . '/api',
],
],
];