You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -385,6 +382,19 @@ public function arbitraryArray(): string
385
382
return'$faker->words()';
386
383
}
387
384
385
+
/**
386
+
* This method is only for `fakeForArray()` or methods only used inside `fakeForArray()`. If needed to use outside `fakeForArray()` context then some changes might be required.
387
+
* Also see OpenAPI extension `x-no-relation` in README.md
388
+
* @param $data
389
+
* @return string|null
390
+
* @throws ExceptionInterface
391
+
* @throws InvalidConfigException
392
+
* @throws InvalidDefinitionException
393
+
* @throws TypeErrorException
394
+
* @throws UnresolvableReferenceException
395
+
* @throws IOException
396
+
* @internal
397
+
*/
388
398
publicfunctionaElementFaker($data): ?string
389
399
{
390
400
$aElementData = Json::decode(Json::encode($data)); // object of stdClass -> array
@@ -393,7 +403,11 @@ public function aElementFaker($data): ?string
393
403
'unnamedProp' => $aElementData['items']
394
404
]
395
405
];
396
-
if (!empty($compoSchemaData['properties']['unnamedProp']['items']['$ref'])) { // TODO
406
+
407
+
// This condition is only for properties with type = array
408
+
// If you intend to use this method from out of `fakeForArray()` context then below condition should be changed depending on your use case
409
+
// Also see OpenAPI extension `x-no-relation` in README.md
410
+
if (!empty($compoSchemaData['properties']['unnamedProp']['items']['$ref'])) {
0 commit comments