mojotech / mojotech/json-type-validation

Feature: dict with number keys

Open
#39 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
154
Forks
14
PR merge metrics
No merged PRs in 30d

Description

Currently the dict decoder only supports keys as string types :
https://github.com/mojotech/json-type-validation/blob/c28d34dd7ecc3d89210573abba56f7cf91ae53cf/src/decoder.ts#L403

Would you accept a pull request to provide the ability to decode dicts with numbers as keys? Happy to do the work and raise if so

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start at the dict decoder in src/decoder.ts around line 403, where the issue identifies the current string-key restriction. Trace the existing decoder behavior and determine the expected result for numeric keys; done means dicts with number keys decode successfully without breaking existing string-key support.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.