Use parameter in API platform annotation

I am looking how to add a dynamic variable into an API Platform @ApiProperty annotation.
I found that Symfony allows that but it does not seem to work in API Platform annotations.
For example :

/**
 * Redirection URL.
 *
 * @Groups({"authorization_code_login_write", "authorization_code_logout_write"})
 * @ApiProperty(
 *     attributes={
 *         "openapi_context"={
 *             "type"="string",
 *             "example"="%app.auth.default.redirect%"
 *         }
 *     }
 * )
 */
protected ?string $redirectionUrl = null;

%app.auth.default.redirect% is not replaced by the container parameter with the same name.
How should I do ?

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *