From 28ca3cc4d1cb039db883c09ccc47d1e6b2a0bf61 Mon Sep 17 00:00:00 2001 From: "Adrian \"Big Challenges\" Olives" Date: Thu, 8 Aug 2024 21:52:24 -0700 Subject: [PATCH 1/2] Multi-Line comment formatting. (#615) --- config/l5-swagger.php | 57 +++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/config/l5-swagger.php b/config/l5-swagger.php index fce7ba1..ae90118 100644 --- a/config/l5-swagger.php +++ b/config/l5-swagger.php @@ -11,37 +11,36 @@ 'routes' => [ /* * Route for accessing api documentation interface - */ + */ 'api' => 'api/documentation', ], 'paths' => [ /* * Edit to include full URL in ui for assets - */ + */ 'use_absolute_path' => env('L5_SWAGGER_USE_ABSOLUTE_PATH', true), /* * File name of the generated json documentation file - */ + */ 'docs_json' => 'api-docs.json', /* * File name of the generated YAML documentation file - */ + */ 'docs_yaml' => 'api-docs.yaml', /* - * Set this to `json` or `yaml` to determine which documentation file to use in UI - */ + * Set this to `json` or `yaml` to determine which documentation file to use in UI + */ 'format_to_use_for_docs' => env('L5_FORMAT_TO_USE_FOR_DOCS', 'json'), /* * Absolute paths to directory containing the swagger annotations are stored. - */ + */ 'annotations' => [ base_path('app'), ], - ], ], ], @@ -49,17 +48,17 @@ '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' => [], @@ -69,36 +68,36 @@ /* * 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), /* * Edit to set path where swagger ui assets should be stored - */ + */ 'swagger_ui_assets_path' => env('L5_SWAGGER_UI_ASSETS_PATH', 'vendor/swagger-api/swagger-ui/dist/'), /* * Absolute path to directories that should be excluded from scanning * @deprecated Please use `scanOptions.exclude` * `scanOptions.exclude` overwrites this - */ + */ 'excludes' => [], ], @@ -138,7 +137,7 @@ * Absolute path to directories that should be excluded from scanning * @note This option overwrites `paths.excludes` * @see \OpenApi\scan - */ + */ 'exclude' => [], /* @@ -155,7 +154,7 @@ 'securitySchemes' => [ /* * Examples of Security schemes - */ + */ /* 'api_key_security_example' => [ // Unique name of security 'type' => 'apiKey', // The type of the security scheme. Valid values are "basic", "apiKey" or "oauth2". @@ -202,7 +201,7 @@ 'security' => [ /* * Examples of Securities - */ + */ [ /* 'oauth2_security_example' => [ @@ -219,42 +218,42 @@ /* * Set this to `true` in development mode so that docs would be regenerated on each request * Set this to `false` to disable swagger generation on production - */ + */ 'generate_always' => env('L5_SWAGGER_GENERATE_ALWAYS', false), /* * Set this to `true` to generate a copy of documentation in yaml format - */ + */ 'generate_yaml_copy' => env('L5_SWAGGER_GENERATE_YAML_COPY', false), /* * Edit to trust the proxy's ip address - needed for AWS Load Balancer * string[] - */ + */ 'proxy' => false, /* * Configs plugin allows to fetch external configs instead of passing them to SwaggerUIBundle. * See more at: https://github.com/swagger-api/swagger-ui#configs-plugin - */ + */ 'additional_config_url' => null, /* * Apply a sort to the operation list of each API. It can be 'alpha' (sort by paths alphanumerically), * 'method' (sort by HTTP method). * Default is the order returned by the server unchanged. - */ + */ 'operations_sort' => env('L5_SWAGGER_OPERATIONS_SORT', null), /* * Pass the validatorUrl parameter to SwaggerUi init on the JS side. * A null value here disables validation. - */ + */ 'validator_url' => null, /* * Swagger UI configuration parameters - */ + */ 'ui' => [ 'display' => [ /* @@ -284,8 +283,8 @@ 'oauth2' => [ /* - * If set to true, adds PKCE to AuthorizationCodeGrant flow - */ + * If set to true, adds PKCE to AuthorizationCodeGrant flow + */ 'use_pkce_with_authorization_code_grant' => false, ], ], From 44bab2467f69c3ec6f17f0b207e9cfcb7074f1b3 Mon Sep 17 00:00:00 2001 From: Ahmad Shakib Date: Fri, 9 Aug 2024 08:31:05 +0330 Subject: [PATCH 2/2] Add dark mode config and styles (#598) Co-authored-by: Darius Matulionis --- config/l5-swagger.php | 1 + resources/views/index.blade.php | 88 ++++++++++++++++++++++++++++++++- 2 files changed, 88 insertions(+), 1 deletion(-) diff --git a/config/l5-swagger.php b/config/l5-swagger.php index ae90118..38bc42a 100644 --- a/config/l5-swagger.php +++ b/config/l5-swagger.php @@ -256,6 +256,7 @@ */ 'ui' => [ 'display' => [ + 'dark_mode' => env('L5_SWAGGER_UI_DARK_MODE', false), /* * Controls the default expansion setting for the operations and tags. It can be : * 'list' (expands only the tags), diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php index da60ada..cc9cc7c 100644 --- a/resources/views/index.blade.php +++ b/resources/views/index.blade.php @@ -25,9 +25,95 @@ background: #fafafa; } + @if(config('l5-swagger.defaults.ui.display.dark_mode')) + + @endif - +