Skip to content
This repository was archived by the owner on Mar 28, 2025. It is now read-only.

Commit 495b863

Browse files
authored
Merge pull request #72 from Catrobat/create-pull-request/patch-1611931124
Bump autogenerated OpenAPI code
2 parents e000f29 + 5cb8a9f commit 495b863

File tree

82 files changed

+693
-319
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+693
-319
lines changed

.openapi-generator/FILES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Model/ProjectUploadRequest.php
3939
Model/RefreshRequest.php
4040
Model/RegisterErrorResponse.php
4141
Model/RegisterRequest.php
42+
Model/SurveyResponse.php
4243
Model/UpdateUserErrorResponse.php
4344
Model/UpdateUserRequest.php
4445
Model/UpdateUserRequestAllOf.php
@@ -74,6 +75,7 @@ Resources/docs/Model/ProjectUploadRequest.md
7475
Resources/docs/Model/RefreshRequest.md
7576
Resources/docs/Model/RegisterErrorResponse.md
7677
Resources/docs/Model/RegisterRequest.md
78+
Resources/docs/Model/SurveyResponse.md
7779
Resources/docs/Model/UpdateUserErrorResponse.md
7880
Resources/docs/Model/UpdateUserRequest.md
7981
Resources/docs/Model/UpdateUserRequestAllOf.md
@@ -113,6 +115,7 @@ Tests/Model/ProjectUploadRequestTest.php
113115
Tests/Model/RefreshRequestTest.php
114116
Tests/Model/RegisterErrorResponseTest.php
115117
Tests/Model/RegisterRequestTest.php
118+
Tests/Model/SurveyResponseTest.php
116119
Tests/Model/UpdateUserErrorResponseTest.php
117120
Tests/Model/UpdateUserRequestAllOfTest.php
118121
Tests/Model/UpdateUserRequestTest.php

Api/ApiServer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.0.52
19+
* The version of the OpenAPI document: v1.0.53
2020
* Contact: webmaster@catrobat.org
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/

Api/AuthenticationApiInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
* API for the Catrobat Share Platform
1717
*
18-
* The version of the OpenAPI document: v1.0.52
18+
* The version of the OpenAPI document: v1.0.53
1919
* Contact: webmaster@catrobat.org
2020
* Generated by: https://github.com/openapitools/openapi-generator.git
2121
*/

Api/MediaLibraryApiInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
* API for the Catrobat Share Platform
1717
*
18-
* The version of the OpenAPI document: v1.0.52
18+
* The version of the OpenAPI document: v1.0.53
1919
* Contact: webmaster@catrobat.org
2020
* Generated by: https://github.com/openapitools/openapi-generator.git
2121
*/

Api/NotificationsApiInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
* API for the Catrobat Share Platform
1717
*
18-
* The version of the OpenAPI document: v1.0.52
18+
* The version of the OpenAPI document: v1.0.53
1919
* Contact: webmaster@catrobat.org
2020
* Generated by: https://github.com/openapitools/openapi-generator.git
2121
*/

Api/ProjectsApiInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
* API for the Catrobat Share Platform
1717
*
18-
* The version of the OpenAPI document: v1.0.52
18+
* The version of the OpenAPI document: v1.0.53
1919
* Contact: webmaster@catrobat.org
2020
* Generated by: https://github.com/openapitools/openapi-generator.git
2121
*/

Api/UserApiInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
* API for the Catrobat Share Platform
1717
*
18-
* The version of the OpenAPI document: v1.0.52
18+
* The version of the OpenAPI document: v1.0.53
1919
* Contact: webmaster@catrobat.org
2020
* Generated by: https://github.com/openapitools/openapi-generator.git
2121
*/

Api/UtilityApiInterface.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
* API for the Catrobat Share Platform
1717
*
18-
* The version of the OpenAPI document: v1.0.52
18+
* The version of the OpenAPI document: v1.0.53
1919
* Contact: webmaster@catrobat.org
2020
* Generated by: https://github.com/openapitools/openapi-generator.git
2121
*/
@@ -48,4 +48,17 @@ interface UtilityApiInterface
4848
* @param array $responseHeaders Additional HTTP headers to return with the response ()
4949
*/
5050
public function healthGet(&$responseCode, array &$responseHeaders);
51+
52+
/**
53+
* Operation surveyLangCodeGet.
54+
*
55+
* Get survey link for given language code.
56+
*
57+
* @param string $lang_code 2 letter Language-Code is based on ISO693-1 (e.g. German = de, English = en, Russian = ru) (required)
58+
* @param int $responseCode The HTTP response code to return
59+
* @param array $responseHeaders Additional HTTP headers to return with the response ()
60+
*
61+
* @return OpenAPI\Server\Model\SurveyResponse
62+
*/
63+
public function surveyLangCodeGet(string $lang_code, &$responseCode, array &$responseHeaders);
5164
}

Controller/AuthenticationController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.0.52
19+
* The version of the OpenAPI document: v1.0.53
2020
* Contact: webmaster@catrobat.org
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/

Controller/Controller.php

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* API for the Catrobat Share Platform
1818
*
19-
* The version of the OpenAPI document: v1.0.52
19+
* The version of the OpenAPI document: v1.0.53
2020
* Contact: webmaster@catrobat.org
2121
* Generated by: https://github.com/openapitools/openapi-generator.git
2222
*/
@@ -98,47 +98,6 @@ public function createErrorResponse(HttpException $exception)
9898
return new Response(json_encode($json, 15, 512), $statusCode, $headers);
9999
}
100100

101-
/**
102-
* Checks whether Content-Type request header presented in supported formats.
103-
*
104-
* @param Request $request request instance
105-
* @param array $consumes array of supported content types
106-
*
107-
* @return bool returns true if Content-Type supported otherwise false
108-
*/
109-
public static function isContentTypeAllowed(Request $request, array $consumes = [])
110-
{
111-
if (!empty($consumes) && '*/*' !== $consumes[0])
112-
{
113-
$currentFormat = $request->getContentType();
114-
foreach ($consumes as $mimeType)
115-
{
116-
// canonize mime type
117-
if (is_string($mimeType) && false !== $pos = strpos($mimeType, ';'))
118-
{
119-
$mimeType = trim(substr($mimeType, 0, $pos));
120-
}
121-
122-
if (!$format = $request->getFormat($mimeType))
123-
{
124-
// add custom format to request
125-
$format = $mimeType;
126-
$request->setFormat($format, $format);
127-
$currentFormat = $request->getContentType();
128-
}
129-
130-
if ($format === $currentFormat)
131-
{
132-
return true;
133-
}
134-
}
135-
136-
return false;
137-
}
138-
139-
return true;
140-
}
141-
142101
/**
143102
* Serializes data to a given type format.
144103
*
@@ -179,6 +138,32 @@ protected function validate($data, $asserts = null)
179138
}
180139
}
181140

141+
/**
142+
* Converts an exception to a serializable array.
143+
*
144+
* @return array
145+
*/
146+
private function exceptionToArray(\Exception $exception = null)
147+
{
148+
if (null === $exception)
149+
{
150+
return null;
151+
}
152+
153+
if (!$this->container->get('kernel')->isDebug())
154+
{
155+
return [
156+
'message' => $exception->getMessage(),
157+
];
158+
}
159+
160+
return [
161+
'message' => $exception->getMessage(),
162+
'type' => get_class($exception),
163+
'previous' => $this->exceptionToArray($exception->getPrevious()),
164+
];
165+
}
166+
182167
protected function getOutputFormat($accept, array $produced)
183168
{
184169
// Figure out what the client accepts
@@ -212,28 +197,43 @@ protected function getOutputFormat($accept, array $produced)
212197
}
213198

214199
/**
215-
* Converts an exception to a serializable array.
200+
* Checks whether Content-Type request header presented in supported formats.
216201
*
217-
* @return array
202+
* @param Request $request request instance
203+
* @param array $consumes array of supported content types
204+
*
205+
* @return bool returns true if Content-Type supported otherwise false
218206
*/
219-
private function exceptionToArray(\Exception $exception = null)
207+
public static function isContentTypeAllowed(Request $request, array $consumes = [])
220208
{
221-
if (null === $exception)
209+
if (!empty($consumes) && '*/*' !== $consumes[0])
222210
{
223-
return null;
224-
}
211+
$currentFormat = $request->getContentType();
212+
foreach ($consumes as $mimeType)
213+
{
214+
// canonize mime type
215+
if (is_string($mimeType) && false !== $pos = strpos($mimeType, ';'))
216+
{
217+
$mimeType = trim(substr($mimeType, 0, $pos));
218+
}
225219

226-
if (!$this->container->get('kernel')->isDebug())
227-
{
228-
return [
229-
'message' => $exception->getMessage(),
230-
];
220+
if (!$format = $request->getFormat($mimeType))
221+
{
222+
// add custom format to request
223+
$format = $mimeType;
224+
$request->setFormat($format, $format);
225+
$currentFormat = $request->getContentType();
226+
}
227+
228+
if ($format === $currentFormat)
229+
{
230+
return true;
231+
}
232+
}
233+
234+
return false;
231235
}
232236

233-
return [
234-
'message' => $exception->getMessage(),
235-
'type' => get_class($exception),
236-
'previous' => $this->exceptionToArray($exception->getPrevious()),
237-
];
237+
return true;
238238
}
239239
}

0 commit comments

Comments
 (0)