@@ -255,4 +255,76 @@ protected function validateRequest()
255
255
throw new \Magento \Framework \Webapi \Exception (__ ('Cannot perform GET operation with store code \'all \'' ));
256
256
}
257
257
}
258
+
259
+ /**
260
+ * Execute schema request
261
+ *
262
+ * @return void
263
+ * @deprecated 100.1.0
264
+ */
265
+ protected function processSchemaRequest ()
266
+ {
267
+ $ requestedServices = $ this ->_request ->getRequestedServices ('all ' );
268
+ $ requestedServices = $ requestedServices == Request::ALL_SERVICES
269
+ ? $ this ->swaggerGenerator ->getListOfServices ()
270
+ : $ requestedServices ;
271
+ $ responseBody = $ this ->swaggerGenerator ->generate (
272
+ $ requestedServices ,
273
+ $ this ->_request ->getScheme (),
274
+ $ this ->_request ->getHttpHost (false ),
275
+ $ this ->_request ->getRequestUri ()
276
+ );
277
+ $ this ->_response ->setBody ($ responseBody )->setHeader ('Content-Type ' , 'application/json ' );
278
+ }
279
+
280
+ /**
281
+ * Execute API request
282
+ *
283
+ * @return void
284
+ * @deprecated 100.1.0
285
+ * @throws AuthorizationException
286
+ * @throws \Magento\Framework\Exception\InputException
287
+ * @throws \Magento\Framework\Webapi\Exception
288
+ */
289
+ protected function processApiRequest ()
290
+ {
291
+ $ inputParams = $ this ->getInputParamsResolver ()->resolve ();
292
+
293
+ $ route = $ this ->getInputParamsResolver ()->getRoute ();
294
+ $ serviceMethodName = $ route ->getServiceMethod ();
295
+ $ serviceClassName = $ route ->getServiceClass ();
296
+
297
+ $ service = $ this ->_objectManager ->get ($ serviceClassName );
298
+ /** @var \Magento\Framework\Api\AbstractExtensibleObject $outputData */
299
+ $ outputData = call_user_func_array ([$ service , $ serviceMethodName ], $ inputParams );
300
+ $ outputData = $ this ->serviceOutputProcessor ->process (
301
+ $ outputData ,
302
+ $ serviceClassName ,
303
+ $ serviceMethodName
304
+ );
305
+ if ($ this ->_request ->getParam (FieldsFilter::FILTER_PARAMETER ) && is_array ($ outputData )) {
306
+ $ outputData = $ this ->fieldsFilter ->filter ($ outputData );
307
+ }
308
+ $ header = $ this ->getDeploymentConfig ()->get (ConfigOptionsListConstants::CONFIG_PATH_X_FRAME_OPT );
309
+ if ($ header ) {
310
+ $ this ->_response ->setHeader ('X-Frame-Options ' , $ header );
311
+ }
312
+ $ this ->_response ->prepareResponse ($ outputData );
313
+ }
314
+
315
+ /**
316
+ * Get deployment config
317
+ *
318
+ * @return DeploymentConfig
319
+ * @deprecated 100.1.0
320
+ */
321
+ private function getDeploymentConfig ()
322
+ {
323
+ if (!$ this ->deploymentConfig instanceof \Magento \Framework \App \DeploymentConfig) {
324
+ $ this ->deploymentConfig = \Magento \Framework \App \ObjectManager::getInstance ()
325
+ ->get (\Magento \Framework \App \DeploymentConfig::class);
326
+ }
327
+ return $ this ->deploymentConfig ;
328
+ }
329
+
258
330
}
0 commit comments