Skip to content

Commit

Permalink
Upgrade to Generator 6 (locally with bug fix) to allow Symfony 6
Browse files Browse the repository at this point in the history
  • Loading branch information
dmetzner committed Jun 3, 2022
1 parent 46c942c commit c5e008e
Show file tree
Hide file tree
Showing 128 changed files with 20,076 additions and 10,419 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/create_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,9 @@ jobs:
- name: Open API code generation
run: |
npm install @openapitools/openapi-generator-cli
npx @openapitools/openapi-generator-cli version-manager set 5
# npx @openapitools/openapi-generator-cli version-manager set 5
npx @openapitools/openapi-generator-cli generate -i catroweb.yaml -g php-symfony -p sortParamsByRequiredFlag=true -p skipFormModel=true -p variableNamingConvention=snake_case -p phpLegacySupport=false -o .

- name: Remove currently broken autogenerated tests & manually overwritten files
run: |
rm -rf Tests
git stash push Service/JmsSerializer.php
git stash push Service/StrictJsonDeserializationVisitor.php
git stash push Service/StrictJsonDeserializationVisitorFactory.php
- name: Permissions
run: sudo chmod -R 777 ./

Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@ on:
jobs:

tests:
if: false # Disabled
name: PHPUnit
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup PHP 7.4
- name: Setup PHP 8.1
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.1

- name: Validate composer.json and composer.lock
run: composer validate
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
# PHPUnit
/app/phpunit.xml
/phpunit.xml
/.phpunit.result.cache

# Build data
/build/
Expand Down
45 changes: 1 addition & 44 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -105,56 +105,13 @@ Resources/docs/Model/UploadErrorResponse.md
Service/JmsSerializer.php
Service/SerializerInterface.php
Service/StrictJsonDeserializationVisitor.php
Service/StrictJsonDeserializationVisitorFactory.php
Service/SymfonyValidator.php
Service/TypeMismatchException.php
Service/ValidatorInterface.php
Tests/Api/AuthenticationApiInterfaceTest.php
Tests/Api/MediaLibraryApiInterfaceTest.php
Tests/Api/NotificationsApiInterfaceTest.php
Tests/Api/ProjectsApiInterfaceTest.php
Tests/Api/SearchApiInterfaceTest.php
Tests/Api/UserApiInterfaceTest.php
Tests/Api/UtilityApiInterfaceTest.php
Tests/AppKernel.php
Tests/Controller/ControllerTest.php
Tests/Model/BaseUserTest.php
Tests/Model/BasicUserDataResponseTest.php
Tests/Model/DryRunTest.php
Tests/Model/ExtendedUserDataResponseAllOfTest.php
Tests/Model/ExtendedUserDataResponseTest.php
Tests/Model/ExtensionResponseTest.php
Tests/Model/FeaturedProjectResponseTest.php
Tests/Model/JWTResponseTest.php
Tests/Model/LoginRequestTest.php
Tests/Model/MediaCategoryResponseTest.php
Tests/Model/MediaFileResponseTest.php
Tests/Model/MediaPackageResponseTest.php
Tests/Model/NotificationContentTest.php
Tests/Model/NotificationResponseTest.php
Tests/Model/NotificationsCountResponseTest.php
Tests/Model/NotificationsTypeTest.php
Tests/Model/OAuthLoginRequestTest.php
Tests/Model/ProjectReportRequestTest.php
Tests/Model/ProjectResponseTest.php
Tests/Model/ProjectsCategoryTest.php
Tests/Model/RefreshRequestTest.php
Tests/Model/RegisterErrorResponseTest.php
Tests/Model/RegisterRequestTest.php
Tests/Model/ResetPasswordErrorResponseTest.php
Tests/Model/ResetPasswordRequestTest.php
Tests/Model/SearchResponseTest.php
Tests/Model/SurveyResponseTest.php
Tests/Model/TagResponseTest.php
Tests/Model/UpdateProjectErrorResponseTest.php
Tests/Model/UpdateProjectFailureResponseTest.php
Tests/Model/UpdateProjectRequestTest.php
Tests/Model/UpdateUserErrorResponseTest.php
Tests/Model/UpdateUserRequestAllOfTest.php
Tests/Model/UpdateUserRequestTest.php
Tests/Model/UpgradeTokenRequestTest.php
Tests/Model/UploadErrorResponseTest.php
Tests/test_config.yml
autoload.php
git_push.sh
phpunit.xml.dist
pom.xml
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.4.0
6.0.1-SNAPSHOT
86 changes: 42 additions & 44 deletions Api/ApiServer.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<?php
/**
* ApiServer.
* ApiServer
*
* PHP version 7.1.3
* PHP version 8.1.1
*
* @category Class
*
* @package OpenAPI\Server\Api
* @author OpenAPI Generator team
*
* @see https://github.com/openapitools/openapi-generator
* @link https://github.com/openapitools/openapi-generator
*/

/**
* Catroweb API.
* Catroweb API
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.0
* The version of the OpenAPI document: v1.1.1
* Contact: [email protected]
* Generated by: https://github.com/openapitools/openapi-generator.git
*
*/

/**
Expand All @@ -30,53 +30,51 @@
namespace OpenAPI\Server\Api;

/**
* ApiServer Class Doc Comment.
* ApiServer Class Doc Comment
*
* PHP version 5
* PHP version 8.1.1
*
* @category Class
*
* @package OpenAPI\Server\Api
* @author OpenAPI Generator team
*
* @see https://github.com/openapitools/openapi-generator
* @link https://github.com/openapitools/openapi-generator
*/
class ApiServer
{
/**
* @var array
*/
private $apis = [];

/**
* Adds an API handler to the server.
*
* @param string $api An API name of the handle
* @param mixed $handler A handler to set for the given API
*/
public function addApiHandler($api, $handler)
{
if (isset($this->apis[$api])) {
throw new \InvalidArgumentException('API has already a handler: '.$api);
}
/**
* @var array
*/
private $apis = array();

$this->apis[$api] = $handler;
}
/**
* Adds an API handler to the server.
*
* @param string $api An API name of the handle
* @param mixed $handler A handler to set for the given API
*/
public function addApiHandler($api, $handler)
{
if (isset($this->apis[$api])) {
throw new \InvalidArgumentException('API has already a handler: '.$api);
}

/**
* Returns an API handler.
*
* @param string $api An API name of the handle
*
* @throws \InvalidArgumentException When no such handler exists
*
* @return mixed Returns a handler
*/
public function getApiHandler($api)
{
if (!isset($this->apis[$api])) {
throw new \InvalidArgumentException('No handler for '.$api.' implemented.');
$this->apis[$api] = $handler;
}

return $this->apis[$api];
}
/**
* Returns an API handler.
*
* @param string $api An API name of the handle
* @return mixed Returns a handler
* @throws \InvalidArgumentException When no such handler exists
*/
public function getApiHandler($api)
{
if (!isset($this->apis[$api])) {
throw new \InvalidArgumentException('No handler for '.$api.' implemented.');
}

return $this->apis[$api];
}
}
Loading

0 comments on commit c5e008e

Please sign in to comment.