Fix TypeScript interface and Python example in README
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.
This commit is contained in:
@@ -333,6 +333,8 @@ print(ex["instructions"]["tr"]) # Turkish
|
||||
print(ex["instructions"]["ru"]) # Russian
|
||||
print(ex["instructions"]["zh"]) # Chinese
|
||||
print(ex["instructions"]["hi"]) # Hindi
|
||||
print(ex["instructions"]["pl"]) # Polish
|
||||
print(ex["instructions"]["ko"]) # Korean
|
||||
```
|
||||
|
||||
### Python — Load with Pandas
|
||||
@@ -406,12 +408,23 @@ interface Exercise {
|
||||
pl: string;
|
||||
ko: string;
|
||||
};
|
||||
instruction_steps: {
|
||||
en: string[];
|
||||
es: string[];
|
||||
it: string[];
|
||||
tr: string[];
|
||||
ru: string[];
|
||||
zh: string[];
|
||||
hi: string[];
|
||||
pl: string[];
|
||||
ko: string[];
|
||||
};
|
||||
muscle_group: string;
|
||||
secondary_muscles: string[];
|
||||
target: string;
|
||||
media_id: string | null;
|
||||
image: string | null;
|
||||
gif_url: string | null;
|
||||
media_id: string;
|
||||
image: string;
|
||||
gif_url: string;
|
||||
attribution: string;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user