Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/jobs/configure-checks/all.bats
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ compile_assertions_finished () {
}

@test "Install GNU C only" {
if [ "$distro_id" = "ID=fedora" ]; then
# Fedora ships with a gcc with enough C++ support
skip
fi
repo-remove clang g++
repo-install gcc libcgroup-dev
compiler_assertions gcc ''
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ jobs:
configuration: phpstan.dist.neon
path: webapp/src webapp/tests
php_extensions: gd intl mysqli pcntl zip
version: composer
4 changes: 2 additions & 2 deletions webapp/config/packages/nelmio_api_doc.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
nelmio_api_doc:
documentation:
servers:
- url: "%domjudge.baseurl%api"
- url: ~ # Will be set by App\NelmioApiDocBundle\ExternalDocDescriber
description: API used at this contest
- url: https://www.domjudge.org/demoweb/api
- url: https://www.domjudge.org/demoweb
description: New API in development
info:
title: DOMjudge
Expand Down
29 changes: 29 additions & 0 deletions webapp/src/NelmioApiDocBundle/ExternalDocDescriber.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php declare(strict_types=1);

namespace App\NelmioApiDocBundle;

use Nelmio\ApiDocBundle\Describer\DescriberInterface;
use Nelmio\ApiDocBundle\Describer\ExternalDocDescriber as BaseExternalDocDescriber;
use Nelmio\ApiDocBundle\OpenApiPhp\Util;
use OpenApi\Annotations\OpenApi;
use Symfony\Component\DependencyInjection\Attribute\AsDecorator;
use Symfony\Component\DependencyInjection\Attribute\AutowireDecorated;
use Symfony\Component\HttpFoundation\RequestStack;

#[AsDecorator(decorates: 'nelmio_api_doc.describers.config')]
class ExternalDocDescriber implements DescriberInterface
{
public function __construct(
#[AutowireDecorated]
protected BaseExternalDocDescriber $decorated,
protected RequestStack $requestStack,
) {}

public function describe(OpenApi $api): void
{
// Inject the correct server for the API docs
$request = $this->requestStack->getCurrentRequest();
$this->decorated->describe($api);
Util::merge($api->servers[0], ['url' => $request->getSchemeAndHttpHost(),], true);
}
}
Loading