Closed Grazulex closed 1 week ago
4.37
Hello, I use a resouce for my response :
return [ 'id' => $this->id, 'name' => $this->name, 'description' => $this->description, 'stats_ongoing' => $this->stats_ongoing, 'probe_type' => new ProbeTypesResource($this->probeType), 'created_at' => new DateTimeResource($this->created_at), 'updated_at' => new DateTimeResource($this->updated_at), 'rules' => $this->when('api/probes' === $request->route()->getPrefix(), fn() => ProbeRulesResource::collection($this->rules)), 'last_metrics' => ProbeMetricsResource::collection($metrics), ];
and in my controller i have this :
#[ResponseFromApiResource(ProbesCollection::class, Probes::class)] public function index(Request $request): JsonResponse
but when i generate the doc, I have this like example :
"id": 36, "team_id": 14, "probe_type_id": 34, "name": "Lela Schinner Jr.", "description": "Quos quia illum impedit vel similique.", "stats_ongoing": 0, "created_at": "2024-06-21T04:00:54.000000Z", "updated_at": "2024-06-21T04:00:54.000000Z"
Why/how can I generate docs with the recursive schema from my resource ?
if I use this in my controller :
it's working wel now....
Scribe version
4.37
Your question
Hello, I use a resouce for my response :
and in my controller i have this :
but when i generate the doc, I have this like example :
Why/how can I generate docs with the recursive schema from my resource ?
Docs