IQSS / IQSS/dataverse-client-javascript

Inconsistency in `DatasetVersionInfo` model? (Date vs string)

未关闭 适合新手
#476 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
TypeScript
星标
20
派生
11
平均合并
2 天 5 小时
30 天内合并 PR
1

描述

I noticed that in the DatasetVersionInfo model, the timestamps use inconsistent types:

https://github.com/IQSS/dataverse-client-javascript/blob/0043dddf5e7d9358d0dcac176cb8c0f325aab78b/src/datasets/domain/models/Dataset.ts#L25-L32

releaseTime and createTime are represented as Date objects, while lastUpdateTime is represented as an ISO 8601 string and not transformed into a Date object:

https://github.com/IQSS/dataverse-client-javascript/blob/0043dddf5e7d9358d0dcac176cb8c0f325aab78b/src/datasets/infra/repositories/transformers/datasetTransformers.ts#L237-L239

The return values from the Dataverse API for retrieving a dataset version are all consistently ISO 8601 strings:

Image

I was wondering what the reason for this is, or whether this inconsistency should be cleaned up? (If so, I'd be open to opening a PR for that)

贡献指南

打开贡献指南

从这里开始

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

调研方向

从 src/datasets/domain/models/Dataset.ts 中引用的 DatasetVersionInfo 定义以及 src/datasets/infra/repositories/transformers/datasetTransformers.ts 中的转换开始。对比 releaseTime、createTime 和 lastUpdateTime 相对于 Dataverse API 响应的表示方式。完成的标准是,模型和 transformer 对这三个字段都使用明确且一致的时间戳表示方式。

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

评估

技术栈
typescript
领域
api, backend-api-design
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
活跃
描述清晰度
基本清楚
新手友好度
68/100

把新 issue 发到你的邮箱

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