<?php

return [

    'default' => 'v1', // 기본 문서 버전

    'documentations' => [

        'v1' => [
            'api' => [
                'title' => 'SAM API V1 문서',
                'version' => '1.0.0',
                'default' => env('L5_SWAGGER_DEFAULT_API_V1', '/api/documentation/v1'),
            ],
            'routes' => [
                'api' => 'api/documentation/v1',
            ],
            'paths' => [
                'docs_json' => 'api-docs-v1.json',
                'docs_yaml' => 'api-docs-v1.yaml',
                'annotations' => [
                    base_path('app/Http/Controllers/Api/V1'),
                    base_path('app/Swagger/v1'),
                ],
            ],
        ],

    ],

    'defaults' => [

        'routes' => [
            'docs' => 'docs',
            'oauth2_callback' => 'api/oauth2-callback',
            'middleware' => [
                'api' => [],
                'asset' => [],
                'docs' => [],
                'oauth2_callback' => [],
            ],
            'group_options' => [],
        ],

        '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' => storage_path('api-docs'),
            'format_to_use_for_docs' => env('L5_FORMAT_TO_USE_FOR_DOCS', 'json'),
            'views' => base_path('resources/views/vendor/l5-swagger'),
            'base' => env('L5_SWAGGER_BASE_PATH', null),
            '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),
        ],

        'securityDefinitions' => [
            'ApiKeyAuth' => [
                'type' => 'apiKey',
                'in' => 'header',
                'name' => 'X-API-KEY',
                'description' => 'API Key 인증: X-API-KEY: {API_KEY}',
            ],
            'securitySchemes' => [
                'ApiKeyAuth' => [
                    'type' => 'apiKey',
                    'in' => 'header',
                    'name' => 'X-API-KEY',
                    'description' => 'API Key 인증: X-API-KEY: {API_KEY}',
                ],
            ],
        ],

        'security' => [
            ['ApiKeyAuth' => []],
        ],

        'generate_always' => env('APP_ENV') !== 'production',
        '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),
                'doc_expansion' => 'list', // "none", "list", "full" 가능
            ],
            'authorization' => [
                'persist_authorization' => env('L5_SWAGGER_UI_PERSIST_AUTHORIZATION', false),
                'oauth2' => [
                    'use_pkce_with_authorization_code_grant' => false,
                ],
            ],
        ],

        'constants' => [
            'L5_SWAGGER_CONST_HOST' => env('L5_SWAGGER_CONST_HOST', 'http://localhost'),
            'L5_SWAGGER_CONST_NAME' => env('L5_SWAGGER_CONST_NAME', 'API 서버'),
        ],
    ],
];
