[pull] master from glideapps:master#75
Open
pull[bot] wants to merge 45 commits into
Open
Conversation
…the enum suffix already disambiguates (#2868) Co-Authored-By: gpt-5.6-sol via pi <noreply@openai.com>
…2005) Co-Authored-By: gpt-5.6-sol via pi <noreply@openai.com>
Co-Authored-By: gpt-5.6-sol via pi <noreply@openai.com>
Swift's default JSONNull class emitted both the deprecated `hashValue` protocol requirement and `hash(into:)`, triggering a 'Hashable.hashValue is deprecated as a protocol requirement' compiler warning. Remove the redundant `hashValue` property and have `hash(into:)` call `hasher.combine(0)` as suggested in the issue. Adds/strengthens a unit test asserting the deprecated property is no longer emitted and that hash(into:) uses hasher.combine(0). Fixes #1698 Co-Authored-By: gpt-5.6-sol via pi <noreply@openai.com>
The Swift name-styling helper hardcoded allUpperWordStyle/allLowerWordStyle for the first word of a name whenever it was recognized as an acronym, ignoring the acronymsStyle derived from the --acronym-style option. Later words in the same name already used acronymsStyle correctly, so an acronym appearing anywhere but the first position was styled correctly while the leading position always came out upper/lower-cased regardless of the option. Co-Authored-By: gpt-5.6-sol via pi <noreply@openai.com>
With --converters all-objects, the JavaScript renderer generates toX/xToJson functions for every object type, but module.exports only listed the top-level converters, making the extra converters unreachable by callers of the module. Co-Authored-By: gpt-5.6-sol via pi <noreply@openai.com>
Co-Authored-By: gpt-5.6-sol via pi <noreply@openai.com>
quicktype's TypeScript input converts .ts sources to JSON Schema via typescript-json-schema, which drops each enum member's original identifier and keeps only its runtime value. Downstream, enum case names were synthesized from the value alone, so values that don't look like valid identifiers (e.g. "000") produced mangled names like The000 instead of the original member name Foo. This affected every target language that renders named enum cases (TypeScript, Swift, etc.), not just TypeScript output. Walk the TypeScript program's EnumDeclaration nodes after schema generation and attach a qt-accessors map (case value -> original member name) to each string enum's schema definition. quicktype-core already consumes qt-accessors as a per-case naming hint without touching the serialized value, so no core changes were needed. Added unit tests in test/unit/typescript-input.test.ts: one asserting the qt-accessors map is generated correctly, and one driving the full pipeline from TypeScript source to rendered TypeScript output to confirm the original member names (not The000/The001/The002) appear in the generated enum. Fixes #1158 Co-Authored-By: gpt-5.6-sol via pi <noreply@openai.com>
…ed (#800) Co-Authored-By: gpt-5.6-sol via pi <noreply@openai.com>
Co-Authored-By: gpt-5.6-sol via pi <noreply@openai.com>
Co-Authored-By: Claude <noreply@anthropic.com>
The attributes-only C# mode emits only the annotated model classes and no
FromJson/ToJson serialization helpers, so the round-trip fixture driver
(TopLevel.FromJson(json).ToJson()) cannot compile against it — CI failed
with CS0117 'TopLevel' does not contain a definition for 'FromJson'.
Remove the two `["simple-object.json", { features: "attributes-only" }]`
quickTestRendererOptions entries added for NewtonSoft and SystemTextJson.
The using-omission behavior is fully covered by the unit tests in
test/unit/csharp-superfluous-usings.test.ts, which is the appropriate
mechanism for asserting that code is *not* generated (a round-trip fixture
cannot exercise attributes-only mode by design).
Co-Authored-By: Claude <noreply@anthropic.com>
The new priority fixture kotlin-enum-class-case-collision.json is a top-level JSON array, which the kotlinx renderer emits as `typealias TopLevel = JsonArray<T>` — invalid Kotlin, since kotlinx's JsonArray takes no type arguments. This is a pre-existing, documented kotlinx limitation (see the ~40 existing top-level-array entries in this same skipJSON block and the TODO in KotlinXRenderer.ts), unrelated to the enum-naming fix in this PR. The enum case/class name-collision fix lives in the shared KotlinRenderer base class and remains covered by the kotlin (klaxon) and kotlin-jackson fixture runs, which handle top-level arrays as `class TopLevel : ArrayList<T>` and do run this fixture. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
#1815) The new priority JSON input kotlin-enum-class-case-collision.json is a top-level array. quicktype's TypeScript --just-types renderer collapses a top-level array's element type onto the top-level name itself instead of emitting an array alias, so the C# code generated from that intermediate TypeScript expects a JSON object and throws when run against the original array JSON. This is the same pre-existing top-level-array limitation already covered by ~70 other entries in skipTypeScriptTests; add this fixture alongside them. Co-Authored-By: gpt-5.6-sol via pi <noreply@openai.com>
…chema (#2868) The new haskell-enum-forbidden.1.fail.enum.json fail sample runs against every language with the "enum" feature, including cjson. cJSON's generated enum getters silently fall back to the first enum member on an unrecognized string instead of failing, the same pre-existing limitation already documented and worked around for enum.schema, enum-large.schema, optional-enum.schema, and const-non-string.schema via the shared skipsEnumValueValidation list. Add the new schema to that list. Co-Authored-By: gpt-5.6-sol via pi <noreply@openai.com>
No workflow run was created for the previous push (b75e57f) despite several hours passing and a close/reopen of the PR; pushing an empty commit to force a fresh synchronize event.
# Conflicts: # test/languages.ts
The C# fixture driver was special-cased to inspect the generated QuickType.cs source whenever the sample filename was enum.1.json. The fixture pipeline is a round-trip harness (deserialize then reserialize and compare JSON); wiring a filename-keyed source assertion into the driver is not something it is built for, and no other language driver does anything like it. Enum case source ordering is invisible to a string round-trip anyway, so the fixture cannot express it. That behavior is already covered directly and portably by test/unit/enum-order.test.ts, which asserts the generated C# and C++ enum declarations preserve schema order via the quicktype API. Co-Authored-By: Claude <noreply@anthropic.com>
# Conflicts: # packages/quicktype-typescript-input/src/index.ts # test/unit/typescript-input.test.ts
…r names The 'Kotlin: enum cases retain their TypeScript string values' test on master asserted the pre-fix synthesized case name (Bringtofront, derived from the value "bringtofront"). With this branch's fix, the original TS member name BRING_TO_FRONT is preserved and rendered as BringToFront, so update the assertion to the corrected output. Co-Authored-By: Claude <noreply@anthropic.com>
# Conflicts: # packages/quicktype-core/src/input/JSONSchemaInput.ts
The issue-1655 fixture driver decided whether to exercise the nested data123
converter by matching the generated source for the exact string
"function toData123(". Replace that brittle hard-coded gate with a check of
the invariant #1655 actually establishes: every converter the generated
module defines (`function to<Name>(json)` / `function <name>ToJson(value)`)
must also be reachable through module.exports. The module's helper functions
have different signatures and are not matched, so the check is general across
samples and converter modes rather than tied to one sample name.
The same sample is rendered with several converter options and the driver
only receives the sample path, so the set of emitted converters is read from
the generated module; in the default (top-level) rendering data123 is simply
never defined and never checked.
Co-Authored-By: Claude <noreply@anthropic.com>
# Conflicts: # test/languages.ts
The default-value.1.fail.no-defaults.json fail sample is an empty object that must be rejected because the schema marks `id` as required. Languages that do not enforce required properties (and therefore already skip required.schema) cannot make that sample fail, so the schema-cjson fixture reported an unexpected pass. Add default-value.schema to skipSchema for exactly those languages (cjson, swift, haskell, typescript-zod, typescript-effect-schema, elixir), mirroring the existing required.schema skips. The positive and negative cases still run on every language that enforces required (cplusplus, csharp, java, python, rust, kotlin, dart, go, ...). Co-Authored-By: Claude <noreply@anthropic.com>
The fixture driver read the generated TopLevel.js back and grepped its source for converter definitions to check they were all exported. That inspection of emitted source belongs in a render-and-inspect unit test, not in the round-trip fixture driver. Move the #1655 regression check into test/unit: render the JS module with converters: all-objects and assert every defined converter appears in the module.exports block (plus a top-level control that shows the nested converter is neither generated nor exported in the default mode). This mirrors the existing java-acronym-names unit test, whose comment explains the same rationale — a round-trip fixture cannot observe the defect because the top-level converter it exercises works regardless. Reverting the renderer fix makes the new test fail. The javascript fixture driver returns to a plain round-trip; issue-1655.json still renders with converters: all-objects, keeping fixture coverage that the mode generates runnable code. Co-Authored-By: Claude <noreply@anthropic.com>
# Conflicts: # test/languages.ts
…grep hack The enum-case naming from issue #2868 was checked by a filename-matching branch in the Haskell fixture's runCommand that grepped the generated QuickType.hs for `= ErrorHealth`. That approach was both a special-case hack and, since haskell-enum-forbidden.schema is skipped for the Haskell fixture via skipsEnumValueValidation (the driver reports decode failures as "null" and exit 0, so its fail sample can't be detected), dead code that never ran. Replace it with a unit test that renders the schema to Haskell and asserts the generated constructors are `OkHealth`/`ErrorHealth` rather than the over-renamed `HealthErrorHealth`. A round-trip fixture cannot express this: the constructor name is invisible to JSON serialization, so correct and over-renamed output round-trip identically. The test fails against the pre-fix renderer and passes against the fix. Co-Authored-By: Claude <noreply@anthropic.com>
fix(rendering): preserve enum case source order
fix(csharp): omit superfluous usings when no converter class is emitted
fix(typescript-input): preserve original enum member names
Define issue submission policy
fix(cpp): initialize class members from JSON Schema default
fix(swift): honor --acronym-style for leading acronyms
fix(js): export all-objects converters from module.exports
fix(haskell): render any-type as Aeson Value instead of Maybe Text
fix(haskell): don't over-rename enum cases when the enum suffix already disambiguates
fix(kotlin): forbid enum case names equal to the enum type name
fix(swift): remove deprecated JSONNull.hashValue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )