@@ -170,20 +170,19 @@ public static function guessModelClass(Operation $operation, $actionType): ?stri
170
170
public static function guessModelClassFromJsonResource (SpecObjectInterface $ property ): array
171
171
{
172
172
$ 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
+ }
185
185
}
186
- return [null , null , null , null ];
187
186
}
188
187
if (self ::isArraySchemaWithRefItems ($ property )) {
189
188
$ ref = $ property ->items ->resolve ();
0 commit comments