Skip to content

Fix TypeScript interface and Python example in README#45

Open
umutcakirai wants to merge 1 commit into
hasaneyldrm:mainfrom
umutcakirai:readme-type-accuracy
Open

Fix TypeScript interface and Python example in README#45
umutcakirai wants to merge 1 commit into
hasaneyldrm:mainfrom
umutcakirai:readme-type-accuracy

Conversation

@umutcakirai

Copy link
Copy Markdown

Three documentation inaccuracies in the README, all independent. Docs only — no data or schema changes.

1. media_id / image / gif_url were typed string | null

No record has a null in any of them, and the JSON Schema declares all three required, non-nullable strings (image and gif_url even carry path patterns):

field nulls in data non-empty string schema type
media_id 0 / 1324 1324 / 1324 string, required
image 0 / 1324 1324 / 1324 string, required
gif_url 0 / 1324 1324 / 1324 string, required

The README's own field table already calls them string. The optional type only pushed needless null-handling onto consumers. Narrowed to string.

2. instruction_steps was missing from the interface

Every record carries it (1324/1324) and the field table documents it, but the TypeScript type omitted it, so data[0].instruction_steps failed to typecheck. Added as string[] per language.

3. The Python example skipped Polish and Korean

It stopped at Hindi while the JavaScript example immediately below lists all nine. Added the two missing lines.

Three documentation inaccuracies, all independent of each other.

1. `media_id`, `image` and `gif_url` were typed `string | null`, but no
   record has a null in any of them (0/1324 each) and the JSON Schema
   declares all three as required, non-nullable strings — `image` and
   `gif_url` even carry path patterns. The optional type pushed needless
   null-handling onto every consumer. Narrowed to `string`.

2. `instruction_steps` was missing from the interface entirely, even
   though every record carries it and the field table documents it.
   Added, typed `string[]` per language.

3. The Python example stopped at Hindi, skipping Polish and Korean; the
   JavaScript example right below it lists both. Added the two lines.

Docs only — no data or schema changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant