Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-webapi
Model
Rest
Swagger.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Webapi\Model\Rest
;
7
8
use
Magento\Webapi\Model\Config
as
ModelConfig
;
9
19
class
Swagger
extends
\Magento\Framework\DataObject
20
{
24
const
SWAGGER_VERSION
=
'2.0'
;
25
29
public
function
__construct
()
30
{
31
$data
= [
32
'swagger'
=>
self::SWAGGER_VERSION
,
33
'info'
=> [
34
'version'
=>
''
,
35
'title'
=>
''
,
36
],
37
];
38
parent::__construct(
$data
);
39
}
40
49
public
function
addPath
(
$path
, $httpOperation, $pathInfo)
50
{
51
$this->_data[
'paths'
][
$path
][$httpOperation] = $pathInfo;
52
return
$this;
53
}
54
61
public
function
addTag
($tagInfo)
62
{
63
$this->_data[
'tags'
][] = $tagInfo;
64
return
$this;
65
}
66
72
public
function
toSchema
()
73
{
74
return
json_encode($this->
toArray
(), JSON_UNESCAPED_SLASHES);
75
}
76
83
public
function
setInfo
(
$info
)
84
{
85
if
(! is_array(
$info
)) {
86
return
$this;
87
}
88
if
(isset(
$info
[
'title'
])) {
89
$this->_data[
'info'
][
'title'
] =
$info
[
'title'
];
90
}
91
if
(isset(
$info
[
'version'
])) {
92
$this->_data[
'info'
][
'version'
] =
$info
[
'version'
];
93
}
94
return
$this;
95
}
96
103
public
function
setBasePath
($basePath)
104
{
105
$this->_data[
'basePath'
] = $basePath;
106
return
$this;
107
}
108
}
Magento\Webapi\Model\Rest\Swagger\SWAGGER_VERSION
const SWAGGER_VERSION
Definition:
Swagger.php:24
Magento\Webapi\Model\Rest\Swagger\addPath
addPath($path, $httpOperation, $pathInfo)
Definition:
Swagger.php:49
Magento\Webapi\Model\Rest\Swagger\addTag
addTag($tagInfo)
Definition:
Swagger.php:61
Magento\Webapi\Model\Config
Definition:
ReaderTest.php:7
Magento\Webapi\Model\Rest\Swagger\setBasePath
setBasePath($basePath)
Definition:
Swagger.php:103
Magento\Framework\DataObject
Definition:
DataObject.php:15
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Framework\DataObject\toArray
toArray(array $keys=[])
Definition:
DataObject.php:245
Magento\Webapi\Model\Rest\Swagger\__construct
__construct()
Definition:
Swagger.php:29
Magento\Webapi\Model\Rest\Swagger
Definition:
Swagger.php:19
Magento\Webapi\Model\Rest
Definition:
Config.php:6
Magento\Webapi\Model\Rest\Swagger\toSchema
toSchema()
Definition:
Swagger.php:72
$info
foreach( $_productCollection as $_product)() ?>" class $info
Definition:
listing.phtml:52
Magento\Webapi\Model\Rest\Swagger\setInfo
setInfo($info)
Definition:
Swagger.php:83
$path
$path
Definition:
import_with_filesystem_images.php:14