diff --git a/.github/workflows/api_platform.yml b/.github/workflows/api_platform.yml index ebf3e3c27dc..654fa98c005 100644 --- a/.github/workflows/api_platform.yml +++ b/.github/workflows/api_platform.yml @@ -1,10 +1,13 @@ -name: CI +name: Distribution update on: push: tags: - v* +env: + GH_TOKEN: ${{ github.token }} + concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true diff --git a/docs/adr/0005-refactor-state-management.md b/docs/adr/0005-refactor-state-management.md index a4196044dab..f5549e17d64 100644 --- a/docs/adr/0005-refactor-state-management.md +++ b/docs/adr/0005-refactor-state-management.md @@ -30,7 +30,7 @@ For API Platform 3, we refactored the whole metadata susbsytem to be more flexib This led to the refactoring of the two main interfaces allowing to plug a data source in API Platform: the state provider and the state processor interfaces. Leveraging these new interfaces, it should be possible to simplify the code base and to remove most code duplication by transforming most of the code currently -stored in the kernel event listeners and in the GraphQL resolvers in dedicated state processors and state providers. +stored in the kernel event listeners and in the GraphQL resolvers in dedicated state processors and state providers. This is quite close to what @alanpoulain proposed in 2019 at https://github.com/api-platform/core/pull/2978 although at that time we needed to refactor the subresource system before tackling this issue. ## Decision Outcome diff --git a/src/Laravel/ApiPlatformProvider.php b/src/Laravel/ApiPlatformProvider.php index 04534fee036..1eda99340bf 100644 --- a/src/Laravel/ApiPlatformProvider.php +++ b/src/Laravel/ApiPlatformProvider.php @@ -744,6 +744,11 @@ public function register(): void oAuthRefreshUrl: $config->get('api-platform.swagger_ui.oauth.refreshUrl', null), oAuthScopes: $config->get('api-platform.swagger_ui.oauth.scopes', []), apiKeys: $config->get('api-platform.swagger_ui.apiKeys', []), + contactName: $config->get('api-platform.swagger_ui.contact.name', ''), + contactUrl: $config->get('api-platform.swagger_ui.contact.url', ''), + contactEmail: $config->get('api-platform.swagger_ui.contact.email', ''), + licenseName: $config->get('api-platform.swagger_ui.license.name', ''), + licenseUrl: $config->get('api-platform.swagger_ui.license.url', ''), ); }); diff --git a/src/Laravel/config/api-platform.php b/src/Laravel/config/api-platform.php index 2d4b68783aa..1531d0ed6d4 100644 --- a/src/Laravel/config/api-platform.php +++ b/src/Laravel/config/api-platform.php @@ -8,6 +8,7 @@ 'title' => 'API Platform', 'description' => 'My awesome API', 'version' => '1.0.0', + 'show_webby' => true, 'routes' => [ // Global middleware applied to every API Platform routes @@ -87,7 +88,16 @@ // 'refreshUrl' => '', // 'scopes' => ['scope1' => 'Description scope 1'], // 'pkce' => true - //] + //], + //'license' => [ + // 'name' => 'Apache 2.0', + // 'url' => 'https://www.apache.org/licenses/LICENSE-2.0.html', + //], + //'contact' => [ + // 'name' => 'API Support', + // 'url' => 'https://www.example.com/support', + // 'email' => 'support@example.com', + //], ], 'url_generation_strategy' => UrlGeneratorInterface::ABS_PATH, diff --git a/src/Laravel/resources/views/swagger-ui.blade.php b/src/Laravel/resources/views/swagger-ui.blade.php index acbe282d933..4a9436c6e0c 100644 --- a/src/Laravel/resources/views/swagger-ui.blade.php +++ b/src/Laravel/resources/views/swagger-ui.blade.php @@ -14,6 +14,7 @@
+ @if (config('api-platform.show_webby', true))
@@ -209,6 +210,7 @@ + @endif