@@ -170,20 +170,19 @@ public static function guessModelClass(Operation $operation, $actionType): ?stri
170170 public static function guessModelClassFromJsonResource (SpecObjectInterface $ property ): array
171171 {
172172 $ schema = $ property instanceof Reference ? $ property ->resolve () : $ property ;
173-
174- if (self ::isObjectSchema ( $ schema ) && ! self :: hasAttributesReference ($ schema )) { # https://github.com/cebe/yii2-openapi/issues/172
175- $ name = self ::schemaNameByRef ($ property );
176- if ($ name !== null ) {
177- return [$ name , '' , '' , 'object ' ];
178- }
179- }
180-
181- if ( self :: isObjectSchema ( $ schema ) && self ::hasAttributesReference ( $ schema )) {
182- $ name = self :: schemaNameByRef ( $ schema -> properties [ ' attributes ' ]);
183- if ( $ name !== null ) {
184- return [ $ name , '' , '' , ' object ' ];
173+ if ( self :: isObjectSchema ( $ schema )) {
174+ if (self ::hasAttributesReference ($ schema )) {
175+ $ name = self ::schemaNameByRef ($ schema -> properties [ ' attributes ' ] );
176+ if ($ name !== null ) {
177+ return [$ name , '' , '' , 'object ' ];
178+ }
179+ return [ null , null , null , null ];
180+ } else { # https://github.com/cebe/yii2-openapi/issues/172
181+ $ name = self ::schemaNameByRef ( $ property );
182+ if ( $ name !== null ) {
183+ return [ $ name, '' , '' , ' object ' ];
184+ }
185185 }
186- return [null , null , null , null ];
187186 }
188187 if (self ::isArraySchemaWithRefItems ($ property )) {
189188 $ ref = $ property ->items ->resolve ();
0 commit comments