Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getResourceUri example
foreach
(
$definitions
as
$definition
)
{
if
(
!
$definition
instanceof EntityDefinition
)
{
continue
;
}
if
(
!
$this
->
shouldDefinitionBeIncluded
(
$definition
)
)
{
continue
;
}
$onlyReference
=
$this
->
shouldIncludeReferenceOnly
(
$definition
,
$forSalesChannel
)
;
$schema
=
$this
->definitionSchemaBuilder->
getSchemaByDefinition
(
$definition
,
$this
->
getResourceUri
(
$definition
)
,
$forSalesChannel
,
$onlyReference
)
;
$openApi
->components->
merge
(
$schema
)
;
}
$this
->
addGeneralInformation
(
$openApi
)
;
$this
->
addContentTypeParameter
(
$openApi
)
;
$data
=
json_decode
(
$openApi
->
toJson
(
)
, true, 512, \JSON_THROW_ON_ERROR
)
;
$data
[
'paths'
]
??=
[
]
;
$schemaPaths
=
[
$this
->schemaPath
]
;
if
(
!
$this
->
shouldDefinitionBeIncluded
(
$definition
)
)
{
continue
;
}
$onlyFlat
=
match
(
$apiType
)
{
DefinitionService::TYPE_JSON => true,
default
=>
$this
->
shouldIncludeReferenceOnly
(
$definition
,
$forSalesChannel
)
,
}
;
$schema
=
$this
->definitionSchemaBuilder->
getSchemaByDefinition
(
$definition
,
$this
->
getResourceUri
(
$definition
)
,
$forSalesChannel
,
$onlyFlat
,
$apiType
)
;
$openApi
->components->
merge
(
$schema
)
;
if
(
$onlyFlat
)
{
continue
;
}