小编Ren*_*haf的帖子

API平台注解中使用参数

我正在研究如何将动态变量添加到 API 平台@ApiProperty注释中。我发现 Symfony 允许这样做,但它似乎不适用于 API 平台注释。例如 :

/**
 * 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;
Run Code Online (Sandbox Code Playgroud)

%app.auth.default.redirect%不被同名的容器参数替换。我应该怎么做 ?

php annotations symfony api-platform.com

5
推荐指数
1
解决办法
2331
查看次数

标签 统计

annotations ×1

api-platform.com ×1

php ×1

symfony ×1