Swift: use file-private JSON helpers for standalone output
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start with the Swift output path that handles the multiFileOutput option and the JSONSchemaSupport.swift helpers. Compare standalone output with --multi-file-output, then add regression coverage for both modes and verify that standalone generated files compile together while multi-file model files still access the helpers.
Written by the indexing model from the issue text.
Description
Problem
Swift output generated with --initializers contains module-level newJSONDecoder() and newJSONEncoder() helpers. When multiple schemas are generated separately and added to the same Swift target, each file defines the same functions and compilation fails with Invalid redeclaration.
The original fix in #1168 made these helpers fileprivate. They were later moved to JSONSchemaSupport.swift in commit ff61903b8, where they were changed back to internal visibility so model files could call the shared support file.
Expected behavior
- Standalone/single-file output: helpers should be
fileprivate, allowing multiple generated files in one module. --multi-file-output: helpers inJSONSchemaSupport.swiftmust remain module-visible because model files call them.
Proposed fix
Emit fileprivate when multiFileOutput is disabled, and keep the current internal visibility when it is enabled. Add regression coverage for both modes.
Related: #1166, #1168.
- Dominant language
- TypeScript
- Stars
- 13.9k
- Forks
- 1.2k
- Avg merge
- 8h 14m
- Merged PRs (30d)
- 368
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from glideapps/quicktype
-
CI
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
-
[BUG]: Openbug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
All issues in glideapps/quicktype
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·