generated from CommonGateway/PetStoreBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
03cc73c
commit e8358ec
Showing
4 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
Installation/Action/ZgwZaakToZdsXmlEncodeAction.action.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"title": "ZgwZaakToZdsXmlEncodeAction.action.json", | ||
"$id": "https://dowr.simxml.nl/action/ZgwZaakToZdsXmlEncodeAction.action.json.action.json", | ||
"$schema": "https://docs.commongateway.nl/schemas/Action.schema.json", | ||
"version": "0.0.1", | ||
"listens": [ | ||
"zgwToZds.xmlEncode" | ||
], | ||
"conditions": { | ||
"==": [1,1] | ||
}, | ||
"class": "CommonGateway\\ZGWToZDSBundle\\ActionHandler\\ZgwToZDSXMLEncodeHandler" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,9 @@ | |
"path": "stuf/zds/requests", | ||
"methods": [ | ||
"POST" | ||
], | ||
"throws": [ | ||
"zgwToZds.xmlEncode" | ||
] | ||
} | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?php | ||
|
||
namespace CommonGateway\ZGWToZDSBundle\ActionHandler; | ||
|
||
use CommonGateway\CoreBundle\ActionHandler\ActionHandlerInterface; | ||
use CommonGateway\ZGWToZDSBundle\Service\ZGWToZDSService; | ||
|
||
|
||
/** | ||
* An action handler that does an xmlEncode on a proxy response after mapping returns json instead of xml. (temporary solution) | ||
* todo: add option to recognize we need to xml encode at the end of handleEndpointsConfigIn function in CoreBundle CallService. | ||
Check warning on line 11 in src/ActionHandler/ZgwToZDSXMLEncodeHandler.php GitHub Actions / build
|
||
* | ||
* @author Conduction.nl <info@conduction.nl>, Wilco Louwerse <wilco@conduction.nl> | ||
* @license EUPL-1.2 https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12 | ||
*/ | ||
class ZgwToZDSXMLEncodeHandler implements ActionHandlerInterface | ||
{ | ||
|
||
/** | ||
* The zgw to zds service used by the handler | ||
* | ||
* @var ZGWToZDSService | ||
*/ | ||
private ZGWToZDSService $service; | ||
|
||
|
||
/** | ||
* The constructor | ||
* | ||
* @param ZGWToZDSService $service The zgw to zds service | ||
*/ | ||
public function __construct(ZGWToZDSService $service) | ||
{ | ||
$this->service = $service; | ||
|
||
}//end __construct() | ||
|
||
|
||
/** | ||
* Returns the required configuration as a https://json-schema.org array. | ||
* | ||
* @return array The configuration that this action should comply to | ||
*/ | ||
public function getConfiguration(): array | ||
{ | ||
return [ | ||
'$id' => 'https://example.com/ActionHandler/ZGWToZDSHandler.ActionHandler.json', | ||
'$schema' => 'https://docs.commongateway.nl/schemas/ActionHandler.schema.json', | ||
'title' => 'ZGW Zaak to ZDS XmlEncode ActionHandler', | ||
'description' => 'ZGW Zaak to ZDS XmlEncode ActionHandler', | ||
'required' => [], | ||
'properties' => [], | ||
]; | ||
|
||
}//end getConfiguration() | ||
|
||
|
||
/** | ||
* This function runs the service. | ||
* | ||
* @param array $data The data from the call | ||
* @param array $configuration The configuration of the action | ||
* | ||
* @return array | ||
* | ||
* @SuppressWarnings("unused") Handlers ara strict implementations | ||
*/ | ||
public function run(array $data, array $configuration): array | ||
{ | ||
|
||
return $this->service->zgwToZdsXmlEncodeHandler($data, $configuration); | ||
|
||
}//end run() | ||
|
||
|
||
}//end class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters