symfony - Api 平台 - 从 swagger 中删除自动代码响应描述
问题描述
我在带有自定义控制器的 POST 方法中有一个端点,我只在我的YAML文件中描述了200 个代码响应。但是当我查看我的招摇文档时,我可以显示 201、400 和 422 代码响应。我怎样才能删除它们?
解决方案
我迟到了,但这对我有用:https ://api-platform.com/docs/core/operations/#configuring-operations
在 config/api_platform/resources.yaml 中,我添加了:
App\Entity\CriteriaDeleteChatRooms:
collectionOperations:
post:
status: 200
完成此操作后,状态码已从 201 更新为 200。
推荐阅读
- c++ - 为什么在下面的代码中使用 string 而不是 char 会显示错误?
- swift - 使用 pan guesture 调整集合视图单元格的大小
- javascript - 将对象数组聚合为对象javascript的单个不同值
- google-cloud-platform - 无法使用 ssh 连接到 gcloud?
- python - tf.python.ops 和 tensorflow.python.framework.ops 是什么关系?
- confluence-rest-api - 如何搜索标题以特定短语开头的页面?
- amazon-web-services - Kibana Snapshot restore .opendistro-alerting-config no permission to restore
- c# - 无法将用 C++ 编写的 Dll 导入 C# .NetCore
- android - 应用程序:compileDebugJavaWithJavac 错误。java.io.IOException:文件名、目录名或卷标语法不正确
- python - 如何使用 Telethon 加入 Telegram 中的多个频道?