@@ -34,29 +34,26 @@ public function fillFromStdProperty(string $propertyName, stdClass $stdProperty)
3434 $ this ->enumClass = $ stdProperty ->{'x-lg-enum-class ' };
3535 }
3636
37- switch (OpenApi3PropertyTypeEnum::from ($ stdProperty ->type )) {
38- case OpenApi3PropertyTypeEnum::OBJECT :
39- $ this ->object = new OpenApi3Object ();
40- $ this ->object ->fillFromStdObject ($ stdProperty );
41-
42- break ;
43- case OpenApi3PropertyTypeEnum::ARRAY :
44- if (std_object_has ($ stdProperty , 'items ' )) {
45- if (std_object_has ($ stdProperty ->items , 'type ' )) {
46- $ this ->items = new OpenApi3ObjectProperty (type: $ stdProperty ->items ->type );
47- $ this ->items ->fillFromStdProperty ("{$ propertyName }.* " , $ stdProperty ->items );
48- } elseif (std_object_has ($ stdProperty ->items , 'allOf ' )) {
49- foreach ($ stdProperty ->items ->allOf as $ allOfItem ) {
50- if (!$ this ->items && std_object_has ($ allOfItem , 'type ' )) {
51- $ this ->items = new OpenApi3ObjectProperty (type: $ allOfItem ->type );
37+ if (std_object_has ($ stdProperty , 'type ' )) {
38+ switch (OpenApi3PropertyTypeEnum::from ($ stdProperty ->type )) {
39+ case OpenApi3PropertyTypeEnum::OBJECT :
40+ $ this ->object = new OpenApi3Object ();
41+ $ this ->object ->fillFromStdObject ($ stdProperty );
42+
43+ break ;
44+ case OpenApi3PropertyTypeEnum::ARRAY :
45+ if (std_object_has ($ stdProperty , 'items ' )) {
46+ do_with_all_of ($ stdProperty ->items , function (stdClass $ p ) use ($ propertyName ) {
47+ if (!$ this ->items && std_object_has ($ p , 'type ' )) {
48+ $ this ->items = new OpenApi3ObjectProperty (type: $ p ->type );
5249 }
53- $ this ->items ?->fillFromStdProperty("{$ propertyName }.* " , $ allOfItem );
54- }
50+ $ this ->items ?->fillFromStdProperty("{$ propertyName }.* " , $ p );
51+ });
5552 }
56- }
5753
58- break ;
59- default :
54+ break ;
55+ default :
56+ }
6057 }
6158 }
6259
0 commit comments