@@ -80,9 +80,7 @@ public function __construct(Container $container)
8080 $ this ->data = $ this ->driver ->getProcessTmpData ();
8181
8282 if (empty ($ this ->data )) {
83- $ this ->data = empty ($ this ->config ['info ' ])
84- ? $ this ->generateEmptyData ()
85- : $ this ->generateEmptyData ($ this ->config ['info ' ]['description ' ]);
83+ $ this ->data = $ this ->generateEmptyData ();
8684
8785 $ this ->driver ->saveProcessTmpData ($ this ->data );
8886 }
@@ -142,6 +140,10 @@ protected function generateEmptyData(?string $view = null, array $viewData = [],
142140 throw new EmptyContactEmailException ();
143141 }
144142
143+ if (empty ($ view ) && !empty ($ this ->config ['info ' ])){
144+ $ view = $ this ->config ['info ' ]['description ' ];
145+ }
146+
145147 $ data = [
146148 'openapi ' => self ::OPEN_API_VERSION ,
147149 'servers ' => [
@@ -811,7 +813,7 @@ public function saveProductionData()
811813 if (ParallelTesting::token ()) {
812814 $ this ->driver ->appendProcessDataToTmpFile (function (array $ sharedTmpData ) {
813815 $ resultDocContent = (empty ($ sharedTmpData ))
814- ? $ this ->data = $ this -> generateEmptyData ($ this ->config ['info ' ]['description ' ])
816+ ? $ this ->generateEmptyData ($ this ->config ['info ' ]['description ' ])
815817 : $ sharedTmpData ;
816818
817819 $ this ->mergeOpenAPIDocs ($ resultDocContent , $ this ->data );
@@ -830,9 +832,6 @@ public function getDocFileContent()
830832
831833 $ this ->openAPIValidator ->validate ($ documentation );
832834 } catch (Exception $ exception ) {
833- $ infoConfig = $ this ->config ['info ' ];
834- $ infoConfig ['description ' ] = Arr::get ($ this ->config , 'defaults.error ' );
835-
836835 return $ this ->generateEmptyData ($ this ->config ['defaults ' ]['error ' ], ['message ' => $ exception ->getMessage ()]);
837836 }
838837
@@ -965,11 +964,7 @@ protected function prepareInfo(?string $view = null, array $viewData = [], array
965964 {
966965 $ info = [];
967966
968- foreach ($ license as $ key => $ value ) {
969- if (empty ($ value )) {
970- unset($ license [$ key ]);
971- }
972- }
967+ $ license = array_filter ($ license , fn ($ value ) => !empty ($ value ));
973968
974969 if (!empty ($ license )) {
975970 $ info ['license ' ] = $ license ;
@@ -981,7 +976,7 @@ protected function prepareInfo(?string $view = null, array $viewData = [], array
981976
982977 $ infoConfig = Arr::except ($ this ->config ['info ' ], ['description ' , 'license ' ]);
983978
984- return array_merge ($ info , $ infoConfig );
979+ return array_merge ($ infoConfig , $ info );
985980 }
986981
987982 protected function getOpenAPIFileContent (string $ filePath ): array
0 commit comments