myMVC_module_OpenApi
1.1.0
pdo -Erweiterunggit clone --branch 3.x https://github.com/gueff/myMVC.git myMVC_3.xGit -Klon
cd /modules/ ;
git clone --branch 1.x
https://github.com/gueff/myMVC_module_OpenApi.git
OpenApi ; Validieren Sie gegen OpenAPI -Datei
use OpenApi Model Validate ;
$ oDTValidateRequestResponse = Validate:: request (
$ oDTRequestCurrent ,
Config:: get_MVC_PUBLIC_PATH () . ' /openapi/api.yaml '
);
header ( ' Content-Type: application/json ' );
echo json_encode (Convert:: objectToArray ( $ oDTValidateRequestResponse ));Validieren Sie gegen OpenAPI -URL
use OpenApi Model Validate ;
// validate against openapi URL
$ oDTValidateRequestResponse = Validate:: request (
$ oDTRequestCurrent ,
' https://example.com/api/openapi.yaml '
);
header ( ' Content-Type: application/json ' );
echo json_encode (Convert:: objectToArray ( $ oDTValidateRequestResponse ));automatische MyMVC-Routen aus der OpenAPI-Datei automatisch schaffen
Alle Strecken führen zu ihrer gegebenen operationId , die in OpenAPI eingestellt ist
OpenApi Model Route:: autoCreateFromOpenApiFile (
Config:: get_MVC_PUBLIC_PATH () . ' /openapi/api.yaml ' ,
' FooControllerApi '
); Alle Routen führen explizit zu Api::delegate()
OpenApi Model Route:: autoCreateFromOpenApiFile (
Config:: get_MVC_PUBLIC_PATH () . ' /openapi/api.yaml ' ,
' FooControllerApi ' ,
' delegate '
);Protokolle werden auf Ereignisse gefeuert.
Verfügbare Veranstaltungen sind:
myMVC_module_OpenApi::sYamlSourceHören Sie sich das Ereignis an und schreiben Sie seinen Inhalt einer Protokolldatei
MVC Event:: bind ( ' myMVC_module_OpenApi::sYamlSource ' , function ( $ sContent ){
MVC Log:: write ( $ sContent , ' openapi.log ' );
});