JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources

Why does immutable only apply to `jsonapi_resources` and not `jsonapi_resource`?

未关闭
#520 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Type: Enhancement
主要语言
Ruby
星标
2.3k
派生
546
PR 合并指标
30 天内没有已合并 PR

描述

It looks like the immutable method is only applied to resources when using the jsonapi_resources method for routing. The immutable method has no effect on resources created with the jsonapi_resource method. Why is this the case?

If I have a resource that isn't queried by id, then can't it also be immutable?

Reference: https://github.com/cerebris/jsonapi-resources/blob/858fdd13515cc4f637d2cb26b7e4be7fb9ed780e/lib/jsonapi/routing_ext.rb#L83

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 lib/jsonapi/routing_ext.rb 中引用的行开始,比较 jsonapi_resources 与 jsonapi_resource 应用 immutable 的方式。确定对于不通过 id 查询的资源,这种差异是否是有意的,然后记录预期行为并验证涉及的 routing 情况。

由索引模型根据 Issue 内容生成。

评估

技术栈
rails, ruby
领域
api, backend
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。