GET /v3/apps/:guid/routes accepts include but ignores it
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 app/controllers/v3/routes_controller.rb 中的 index_by_app 开始,并将其与 index 进行比较;index 已经会根据 message.include 应用装饰器。检查路由控制器中针对这两个端点的请求规格,以及 docs/v3/source/includes/resources/routes/_list_for_app.md.erb 中的端点文档。完成标准是:应用路由端点对有效的 include 参数的处理与通用路由端点保持一致,并且文档反映了这一行为。
由索引模型根据 Issue 内容生成。
描述
GET /v3/routes?include=domain returns the domains under included; GET /v3/apps/:guid/routes?include=domain returns 200 with no included at all.
Both actions build a RoutesListMessage, which allows and validates include (routes_list_message.rb:12,19):
validates_with IncludeParamValidator, valid_values: ['domain', 'space', 'space.organization', 'route_policies']
index turns it into decorators (routes_controller.rb:46-50):
decorators = []
decorators << IncludeRouteDomainDecorator if IncludeRouteDomainDecorator.match?(message.include)
decorators << IncludeSpaceDecorator if IncludeSpaceDecorator.match?(message.include)
decorators << IncludeOrganizationDecorator if IncludeOrganizationDecorator.match?(message.include)
decorators << IncludeRoutePoliciesDecorator if IncludeRoutePoliciesDecorator.match?(message.include)
index_by_app (routes_controller.rb:299-327) validates the same message and renders PaginatedListPresenter without decorators:, so a valid include is accepted and dropped.
The v3 docs for this endpoint don't list include (routes/_list_for_app.md.erb), so either fix is consistent with them: apply the same decorators in index_by_app (and document include), or reject include there. Applying them seems the expected behaviour, since every other route list supports it. Happy to send a PR for whichever you prefer.
Found with a contract check of the v3 docs, the OpenAPI spec and the request messages (see #5496).
- 主要语言
- Ruby
- 星标
- 208
- 派生
- 374
- 平均合并
- 2 天 17 小时
- 30 天内合并 PR
- 78
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cloudfoundry/cloud_controller_ng 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 72/100
cloudfoundry/cloud_controller_ng#5255 · 1 条评论 ·
维护者通常 3 天内回复
-
难度 4/5 3-5 天 新手友好度 43/100
cloudfoundry/cloud_controller_ng#5599 ·
维护者通常 3 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
cloudfoundry/cloud_controller_ng#5347 · 2 条评论 ·
维护者通常 3 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
cloudfoundry/cloud_controller_ng#5313 ·
维护者通常 3 天内回复
-
难度 4/5 3-5 天 新手友好度 50/100
cloudfoundry/cloud_controller_ng#5285 ·
维护者通常 3 天内回复
查看 cloudfoundry/cloud_controller_ng 的全部 Issue
相似的 Issue
-
Bug Ruby
难度 2/5 1-3 小时 新手友好度 76/100
getsentry/sentry-ruby#3211 · 1 条评论 ·
维护者通常 2 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 66/100
internetee/registry#2984 ·
维护者通常 6 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
ecosyste-ms/issues#862 ·
维护者通常 1 天内回复
-
Redis Lua error `@user_script:52: ERR value is not an integer or out of range` when `window_size` is configured可能已有人在做 @mimosa 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
riscv/riscv-unified-db#2829 ·
维护者通常 1 天内回复