swagger - 用openapi_context(Swagger)中的自定义参数替换“id”参数 - api-platform
问题描述
我有一个实体的自定义操作,它使用PUT
方法,我想在我的招摇(OpenApi)文档中记录参数。
这是定义
/*
* itemOperations={
* "get",
* "patch",
* "put",
* "delete",
* "activate"={
* "method"="PUT",
* "path"="/user/{token}/activate",
* "requirements"={"token"="^\w{32}$"},
* "controller"=ActivateUser::class,
* "normalization_context"={"groups"={"user:read"}},
* "denormalization_context"={"groups"={"user:activation"}},
* "read"=false,
* "validation_groups"={"Activate"},
* "openapi_context"={
* "summary"="Attiva un utente tramite token dopo la registrazione.",
* "description"="Cambia lo stato dell'utente in 'attivo' permettendo così il login.",
* "parameters"={
* {
* "in"="path",
* "name"="token",
* "required"=true,
* "type"="string",
* "description"="Il token generato al momento della registrazione."
* }
* }
* }
* },
* },
*/
感兴趣的部分是"openapi_context"
关键"parameters"
。此描述不会更改有关参数定义的任何内容,ID 要求仍然存在并且没有令牌描述(我在此处阅读文档以了解开放 api 上下文中的路径参数
我哪里错了?有没有办法做到这一点?
解决方案
推荐阅读
- r - 在ggplot中显示绘图区域外的刻度标签?
- javascript - 基于日期和时间,显示/隐藏元素
- javascript - 如何从 AWS.CognitoIdentityServiceProvider 加载类型定义?
- azure-devops - Azure -> Pipelines -> Releases 上的应用服务名称为空
- java - 如何将一对多结果映射到使用非主键连接的 Hibernate 实体?
- javascript - 调度冒泡的 CustomEvent 有什么缺点吗?
- scala - 使用 SttpBackendStub 进行单元测试流请求
- linux - 如果等于或小于,则需要带 awk 的 hep
- laravel - Laravel 存储可访问性混乱
- python - 硒元素选择:Instagram 评论