Custom rule #413
-
hello good! I have a custom rule and I can't find a way to document it, I leave an example: SetAvatarRequest.php public function rules(): array
Thank you so much! |
Beta Was this translation helpful? Give feedback.
Answered by
romalytvynenko
Jun 10, 2024
Replies: 1 comment
-
@fixytech hey! You can implement method use Dedoc\Scramble\Support\Generator\Types\Type as OpenApiType;
public function docs(OpenApiType $prevType, TypeTransformer $openApiTransformer): OpenApiType; For example: use Dedoc\Scramble\Support\Generator\Types\Type as OpenApiType;
use Dedoc\Scramble\Support\Generator\Types\StringType;
public function docs(OpenApiType $prevType, TypeTransformer $openApiTransformer): OpenApiType
{
return (new StringType)->format('password');
} This is not documented feature as in the near future I plan to change namespaces and potentially the API for this feature. But for now it should do the work. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
romalytvynenko
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@fixytech hey!
You can implement method
docs
on your rule class:For example:
This is not documented feature as in the near future I plan to change namespaces and potentially the API for this feature.
But for now it should do the work.