Skip to content
This repository was archived by the owner on Mar 28, 2025. It is now read-only.
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: 0 additions & 4 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.coveralls.yml
.gitignore
.php_cs.dist
.travis.yml
Api/ApiServer.php
Expand Down Expand Up @@ -37,7 +36,6 @@ Model/NotificationsType.php
Model/OAuthLoginRequest.php
Model/ProjectReportRequest.php
Model/ProjectResponse.php
Model/ProjectUploadRequest.php
Model/ProjectsCategory.php
Model/RefreshRequest.php
Model/RegisterErrorResponse.php
Expand Down Expand Up @@ -76,7 +74,6 @@ Resources/docs/Model/NotificationsType.md
Resources/docs/Model/OAuthLoginRequest.md
Resources/docs/Model/ProjectReportRequest.md
Resources/docs/Model/ProjectResponse.md
Resources/docs/Model/ProjectUploadRequest.md
Resources/docs/Model/ProjectsCategory.md
Resources/docs/Model/RefreshRequest.md
Resources/docs/Model/RegisterErrorResponse.md
Expand Down Expand Up @@ -119,7 +116,6 @@ Tests/Model/NotificationsTypeTest.php
Tests/Model/OAuthLoginRequestTest.php
Tests/Model/ProjectReportRequestTest.php
Tests/Model/ProjectResponseTest.php
Tests/Model/ProjectUploadRequestTest.php
Tests/Model/ProjectsCategoryTest.php
Tests/Model/RefreshRequestTest.php
Tests/Model/RegisterErrorResponseTest.php
Expand Down
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.0-beta3
5.1.0
8 changes: 3 additions & 5 deletions Api/ApiServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.0.60
* The version of the OpenAPI document: v1.0.61
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down Expand Up @@ -55,8 +55,7 @@ class ApiServer
*/
public function addApiHandler($api, $handler)
{
if (isset($this->apis[$api]))
{
if (isset($this->apis[$api])) {
throw new \InvalidArgumentException('API has already a handler: '.$api);
}

Expand All @@ -74,8 +73,7 @@ public function addApiHandler($api, $handler)
*/
public function getApiHandler($api)
{
if (!isset($this->apis[$api]))
{
if (!isset($this->apis[$api])) {
throw new \InvalidArgumentException('No handler for '.$api.' implemented.');
}

Expand Down
2 changes: 1 addition & 1 deletion Api/AuthenticationApiInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.0.60
* The version of the OpenAPI document: v1.0.61
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
2 changes: 1 addition & 1 deletion Api/MediaLibraryApiInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.0.60
* The version of the OpenAPI document: v1.0.61
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
2 changes: 1 addition & 1 deletion Api/NotificationsApiInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.0.60
* The version of the OpenAPI document: v1.0.61
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
2 changes: 1 addition & 1 deletion Api/ProjectsApiInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.0.60
* The version of the OpenAPI document: v1.0.61
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
2 changes: 1 addition & 1 deletion Api/SearchApiInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.0.60
* The version of the OpenAPI document: v1.0.61
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
2 changes: 1 addition & 1 deletion Api/UserApiInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.0.60
* The version of the OpenAPI document: v1.0.61
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
2 changes: 1 addition & 1 deletion Api/UtilityApiInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.0.60
* The version of the OpenAPI document: v1.0.61
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down
95 changes: 29 additions & 66 deletions Controller/AuthenticationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.0.60
* The version of the OpenAPI document: v1.0.61
* Contact: webmaster@catrobat.org
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
Expand Down Expand Up @@ -70,12 +70,9 @@ public function authenticationDeleteAction(Request $request)
// Use the default value if no value was provided

// Deserialize the input values that needs it
try
{
try {
$x_refresh = $this->deserialize($x_refresh, 'string', 'string');
}
catch (SerializerRuntimeException $exception)
{
} catch (SerializerRuntimeException $exception) {
return $this->createBadRequestResponse($exception->getMessage());
}

Expand All @@ -84,13 +81,11 @@ public function authenticationDeleteAction(Request $request)
$asserts[] = new Assert\NotNull();
$asserts[] = new Assert\Type('string');
$response = $this->validate($x_refresh, $asserts);
if ($response instanceof Response)
{
if ($response instanceof Response) {
return $response;
}

try
{
try {
$handler = $this->getApiHandler();

// Set authentication method 'PandaAuth'
Expand Down Expand Up @@ -133,9 +128,7 @@ public function authenticationDeleteAction(Request $request)
]
)
);
}
catch (Exception $fallthrough)
{
} catch (Exception $fallthrough) {
return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
}
}
Expand All @@ -162,8 +155,7 @@ public function authenticationGetAction(Request $request)

// Validate the input values

try
{
try {
$handler = $this->getApiHandler();

// Set authentication method 'PandaAuth'
Expand Down Expand Up @@ -197,9 +189,7 @@ public function authenticationGetAction(Request $request)
]
)
);
}
catch (Exception $fallthrough)
{
} catch (Exception $fallthrough) {
return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
}
}
Expand All @@ -217,8 +207,7 @@ public function authenticationOauthPostAction(Request $request)
{
// Make sure that the client is providing something that we can consume
$consumes = ['application/json'];
if (!static::isContentTypeAllowed($request, $consumes))
{
if (!static::isContentTypeAllowed($request, $consumes)) {
// We can't consume the content that the client is sending us
return new Response('', 415);
}
Expand All @@ -228,8 +217,7 @@ public function authenticationOauthPostAction(Request $request)
// Figure out what the client accepts
$clientAccepts = $request->headers->has('Accept') ? $request->headers->get('Accept') : '*/*';
$responseFormat = $this->getOutputFormat($clientAccepts, $produces);
if (null === $responseFormat)
{
if (null === $responseFormat) {
return new Response('', 406);
}

Expand All @@ -241,13 +229,10 @@ public function authenticationOauthPostAction(Request $request)
// Use the default value if no value was provided

// Deserialize the input values that needs it
try
{
try {
$inputFormat = $request->getMimeType($request->getContentType());
$o_auth_login_request = $this->deserialize($o_auth_login_request, 'OpenAPI\Server\Model\OAuthLoginRequest', $inputFormat);
}
catch (SerializerRuntimeException $exception)
{
} catch (SerializerRuntimeException $exception) {
return $this->createBadRequestResponse($exception->getMessage());
}

Expand All @@ -257,13 +242,11 @@ public function authenticationOauthPostAction(Request $request)
$asserts[] = new Assert\Type('OpenAPI\\Server\\Model\\OAuthLoginRequest');
$asserts[] = new Assert\Valid();
$response = $this->validate($o_auth_login_request, $asserts);
if ($response instanceof Response)
{
if ($response instanceof Response) {
return $response;
}

try
{
try {
$handler = $this->getApiHandler();

// Make the call to the business logic
Expand Down Expand Up @@ -307,9 +290,7 @@ public function authenticationOauthPostAction(Request $request)
]
)
);
}
catch (Exception $fallthrough)
{
} catch (Exception $fallthrough) {
return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
}
}
Expand All @@ -327,8 +308,7 @@ public function authenticationPostAction(Request $request)
{
// Make sure that the client is providing something that we can consume
$consumes = ['application/json'];
if (!static::isContentTypeAllowed($request, $consumes))
{
if (!static::isContentTypeAllowed($request, $consumes)) {
// We can't consume the content that the client is sending us
return new Response('', 415);
}
Expand All @@ -338,8 +318,7 @@ public function authenticationPostAction(Request $request)
// Figure out what the client accepts
$clientAccepts = $request->headers->has('Accept') ? $request->headers->get('Accept') : '*/*';
$responseFormat = $this->getOutputFormat($clientAccepts, $produces);
if (null === $responseFormat)
{
if (null === $responseFormat) {
return new Response('', 406);
}

Expand All @@ -354,13 +333,10 @@ public function authenticationPostAction(Request $request)
// Use the default value if no value was provided

// Deserialize the input values that needs it
try
{
try {
$inputFormat = $request->getMimeType($request->getContentType());
$login_request = $this->deserialize($login_request, 'OpenAPI\Server\Model\LoginRequest', $inputFormat);
}
catch (SerializerRuntimeException $exception)
{
} catch (SerializerRuntimeException $exception) {
return $this->createBadRequestResponse($exception->getMessage());
}

Expand All @@ -370,13 +346,11 @@ public function authenticationPostAction(Request $request)
$asserts[] = new Assert\Type('OpenAPI\\Server\\Model\\LoginRequest');
$asserts[] = new Assert\Valid();
$response = $this->validate($login_request, $asserts);
if ($response instanceof Response)
{
if ($response instanceof Response) {
return $response;
}

try
{
try {
$handler = $this->getApiHandler();

// Set authentication method 'PandaAuth'
Expand Down Expand Up @@ -420,9 +394,7 @@ public function authenticationPostAction(Request $request)
]
)
);
}
catch (Exception $fallthrough)
{
} catch (Exception $fallthrough) {
return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
}
}
Expand All @@ -440,8 +412,7 @@ public function authenticationRefreshPostAction(Request $request)
{
// Make sure that the client is providing something that we can consume
$consumes = ['application/json'];
if (!static::isContentTypeAllowed($request, $consumes))
{
if (!static::isContentTypeAllowed($request, $consumes)) {
// We can't consume the content that the client is sending us
return new Response('', 415);
}
Expand All @@ -451,8 +422,7 @@ public function authenticationRefreshPostAction(Request $request)
// Figure out what the client accepts
$clientAccepts = $request->headers->has('Accept') ? $request->headers->get('Accept') : '*/*';
$responseFormat = $this->getOutputFormat($clientAccepts, $produces);
if (null === $responseFormat)
{
if (null === $responseFormat) {
return new Response('', 406);
}

Expand All @@ -467,13 +437,10 @@ public function authenticationRefreshPostAction(Request $request)
// Use the default value if no value was provided

// Deserialize the input values that needs it
try
{
try {
$inputFormat = $request->getMimeType($request->getContentType());
$refresh_request = $this->deserialize($refresh_request, 'OpenAPI\Server\Model\RefreshRequest', $inputFormat);
}
catch (SerializerRuntimeException $exception)
{
} catch (SerializerRuntimeException $exception) {
return $this->createBadRequestResponse($exception->getMessage());
}

Expand All @@ -483,13 +450,11 @@ public function authenticationRefreshPostAction(Request $request)
$asserts[] = new Assert\Type('OpenAPI\\Server\\Model\\RefreshRequest');
$asserts[] = new Assert\Valid();
$response = $this->validate($refresh_request, $asserts);
if ($response instanceof Response)
{
if ($response instanceof Response) {
return $response;
}

try
{
try {
$handler = $this->getApiHandler();

// Set authentication method 'PandaAuth'
Expand Down Expand Up @@ -533,9 +498,7 @@ public function authenticationRefreshPostAction(Request $request)
]
)
);
}
catch (Exception $fallthrough)
{
} catch (Exception $fallthrough) {
return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));
}
}
Expand Down
Loading