@@ 110-122 (lines=13) @@ | ||
107 | * |
|
108 | * @return Response |
|
109 | */ |
|
110 | public function createBodyNotDeserializableResponse(Request $request, string $accept, string $contentType): Response |
|
111 | { |
|
112 | return $this->createResponseByError($request, 400, $accept, new Error( |
|
113 | Error::SCOPE_BODY, |
|
114 | 'body_not_deserializable', |
|
115 | 'the given body is not deserializable with given content-type', |
|
116 | 'deserialize', |
|
117 | [ |
|
118 | 'contentType' => $contentType, |
|
119 | 'body' => (string) $request->getBody(), |
|
120 | ] |
|
121 | )); |
|
122 | } |
|
123 | ||
124 | /** |
|
125 | * @param Request $request |
|
@@ 192-204 (lines=13) @@ | ||
189 | * |
|
190 | * @return Response |
|
191 | */ |
|
192 | public function createContentTypeNotSupportedResponse(Request $request, string $accept): Response |
|
193 | { |
|
194 | return $this->createResponseByError($request, 415, $accept, new Error( |
|
195 | Error::SCOPE_HEADER, |
|
196 | 'contentype_not_supported', |
|
197 | 'the given content type is not supported', |
|
198 | 'content-type', |
|
199 | [ |
|
200 | 'contentType' => $request->getHeaderLine('Content-Type'), |
|
201 | 'supportedContentTypes' => $this->requestManager->getSupportedContentTypes(), |
|
202 | ] |
|
203 | )); |
|
204 | } |
|
205 | ||
206 | /** |
|
207 | * @param Request $request |