knuckleswtf / scribe

Generate API documentation for humans from your Laravel codebase.✍
https://scribe.knuckles.wtf/laravel/
MIT License
1.59k stars 280 forks source link

Latest version is a breaking change #715

Closed rabol closed 10 months ago

rabol commented 10 months ago
          This is a breaking change

After I updated to the latest version i get this error:

 TypeError 

  Cannot assign null to property Knuckles\Camel\Extraction\Parameter::$enumValues of type array

  at vendor/spatie/data-transfer-object/src/Reflection/DataTransferObjectProperty.php:48

Originally posted by @rabol in https://github.com/knuckleswtf/scribe/issues/713#issuecomment-1692904954

rabol commented 10 months ago

this is causing the above issue:

 #[Endpoint('Get signature', 'This endpoint allows you to retrieve an stored signature')]
 #[UrlParam('signature_id', 'Id uf the signature', example: '42342-4234-rfdsff-3432f')]

    public function show(Request $request, string $signature_id)
    {
        $us = UserSignature::whereId($signature_id)->first();
        if (is_null($us)) {
            return $this->sendError(error: 'Signature does not exists');
        }

        if ($us->user_id != $request->user()->id) {
            return $this->sendError(error: 'Signature does not belong to you');
        }

        return $this->sendResponse(new UserSignatureResource($us));
    }

There is no Enum in the above

if I uncomment all #[UrlParam() it works

shalvah commented 10 months ago

Hmm, thought I had covered for that, but I'll take a look.

shalvah commented 10 months ago

This should be fixed now (4.23.1).