File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -226,8 +226,8 @@ public function getQueryParameters(): array
226226 ->count ()
227227 ;
228228 if ($ this ->forceRandom || ($ this ->autoComplete && \count (
229- $ this ->queryParameters
230- ) < $ definitionParamsCount )) {
229+ $ this ->queryParameters
230+ ) < $ definitionParamsCount )) {
231231 $ randomQueryParams = $ this ->parent
232232 ->getQueryParameters ()
233233 ->getRandomExamples ()
@@ -265,8 +265,8 @@ public function getHeaders(): array
265265
266266 if ($ this ->parent !== null ) {
267267 $ definitionHeadersCount = $ this ->parent
268- ->getHeaders ()
269- ->count () + 1 // content-type
268+ ->getHeaders ()
269+ ->count () + 1 // content-type
270270 ;
271271
272272 if ($ this ->parent ->getSecurities ()->count () > 0 ) {
@@ -324,7 +324,10 @@ public function getBody(): ?BodyExample
324324 if ($ this ->autoComplete ) {
325325 $ randomBody = BodyExample::create ($ requestBody ->getRandomContent ());
326326 if ($ this ->body !== null ) {
327- $ this ->body ->setContent (array_merge ($ randomBody ->getContent (), $ this ->body ->getContent ()));
327+ $ content = $ this ->body ->getContent ();
328+ if (!isset ($ content [0 ])) {
329+ $ this ->body ->setContent (array_merge ($ randomBody ->getContent (), $ content ));
330+ }
328331 } else {
329332 $ this ->body = $ randomBody ;
330333 }
You can’t perform that action at this time.
0 commit comments