Skip to content

Commit

Permalink
Merge branch 'master' into use-attributes-in-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkaOnLine committed Aug 9, 2024
2 parents 8d51ba9 + 44bab24 commit 092feaa
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 30 deletions.
58 changes: 29 additions & 29 deletions config/l5-swagger.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,55 +11,54 @@
'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'),
],

],
],
],
'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' => [],
Expand All @@ -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' => [],
],

Expand Down Expand Up @@ -138,7 +137,7 @@
* Absolute path to directories that should be excluded from scanning
* @note This option overwrites `paths.excludes`
* @see \OpenApi\scan
*/
*/
'exclude' => [],

/*
Expand All @@ -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".
Expand Down Expand Up @@ -202,7 +201,7 @@
'security' => [
/*
* Examples of Securities
*/
*/
[
/*
'oauth2_security_example' => [
Expand All @@ -219,44 +218,45 @@
/*
* 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' => [
'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),
Expand Down Expand Up @@ -284,8 +284,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,
],
],
Expand Down
88 changes: 87 additions & 1 deletion resources/views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,95 @@
background: #fafafa;
}
</style>
@if(config('l5-swagger.defaults.ui.display.dark_mode'))
<style>
body#dark-mode,
#dark-mode .scheme-container {
background: #1b1b1b;
}
#dark-mode .scheme-container,
#dark-mode .opblock .opblock-section-header{
box-shadow: 0 1px 2px 0 rgba(255, 255, 255, 0.15);
}
#dark-mode .operation-filter-input,
#dark-mode .dialog-ux .modal-ux,
#dark-mode input[type=email],
#dark-mode input[type=file],
#dark-mode input[type=password],
#dark-mode input[type=search],
#dark-mode input[type=text],
#dark-mode textarea{
background: #343434;
color: #e7e7e7;
}
#dark-mode .title,
#dark-mode li,
#dark-mode p,
#dark-mode table,
#dark-mode label,
#dark-mode .opblock-tag,
#dark-mode .opblock .opblock-summary-operation-id,
#dark-mode .opblock .opblock-summary-path,
#dark-mode .opblock .opblock-summary-path__deprecated,
#dark-mode h1,
#dark-mode h2,
#dark-mode h3,
#dark-mode h4,
#dark-mode h5,
#dark-mode .btn,
#dark-mode .tab li,
#dark-mode .parameter__name,
#dark-mode .parameter__type,
#dark-mode .prop-format,
#dark-mode .loading-container .loading:after{
color: #e7e7e7;
}
#dark-mode .opblock-description-wrapper p,
#dark-mode .opblock-external-docs-wrapper p,
#dark-mode .opblock-title_normal p,
#dark-mode .response-col_status,
#dark-mode table thead tr td,
#dark-mode table thead tr th,
#dark-mode .response-col_links,
#dark-mode .swagger-ui{
color: wheat;
}
#dark-mode .parameter__extension,
#dark-mode .parameter__in,
#dark-mode .model-title{
color: #949494;
}
#dark-mode table thead tr td,
#dark-mode table thead tr th{
border-color: rgba(120,120,120,.2);
}
#dark-mode .opblock .opblock-section-header{
background: transparent;
}
#dark-mode .opblock.opblock-post{
background: rgba(73,204,144,.25);
}
#dark-mode .opblock.opblock-get{
background: rgba(97,175,254,.25);
}
#dark-mode .opblock.opblock-put{
background: rgba(252,161,48,.25);
}
#dark-mode .opblock.opblock-delete{
background: rgba(249,62,62,.25);
}
#dark-mode .loading-container .loading:before{
border-color: rgba(255,255,255,10%);
border-top-color: rgba(255,255,255,.6);
}
#dark-mode svg:not(:root){
fill: #e7e7e7;
}
</style>
@endif
</head>

<body>
<body @if(config('l5-swagger.defaults.ui.display.dark_mode')) id="dark-mode" @endif>
<div id="swagger-ui"></div>

<script src="{{ l5_swagger_asset($documentation, 'swagger-ui-bundle.js') }}"></script>
Expand Down

0 comments on commit 092feaa

Please sign in to comment.