训练题单中章节的 ID 不能为 0 但可以为负

Open
#1,161 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Active
Tech stack
typescript
Domain
backend

Research direction

No file, test, or entry point is named. Start by reproducing the validation with the supplied chapter JSON, then trace the code that reports "each node should have a _id". Done means the handling of _id values is consistent for 0 and negative numbers, with regression coverage for both cases.

Written by the indexing model from the issue text.

Description

如附件图片,训练题单中章节的 _id 如果为 0 会提示 each node should have a _id,但可以为负。示例代码:

[
  {
    "_id": -1,
    "title": "环境测试",
    "requireNids": [],
    "pids": [
      1
    ]
  }
]
Image
Dominant language
TypeScript
Stars
7.3k
Forks
504
Avg merge
11h 29m
Merged PRs (30d)
2

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hydro-dev/Hydro

All issues in hydro-dev/Hydro

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.