feat(options)!: unify --just-types across all languages#2943
Merged
Conversation
…an enum Most languages spell "generate plain types without (de)serialization helpers" as a `just-types` boolean option, but C# spelled it `--features just-types` and Kotlin, Scala 3, and Smithy4s `--framework just-types`, so the common `--just-types` flag was rejected for them with an option-parsing error. Those four languages now also accept `just-types` (secondary option). When it's set, makeRenderer forces the corresponding enum option to its just-types value before resolving options, so the boolean wins over a conflicting explicit enum value. The enum spellings keep working unchanged. The renderer-options type test that used kotlin + just-types as its "another language's option" compile error now uses rust, which really has no such option. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
BREAKING CHANGE: the enum spellings of "plain types" are gone. C# loses `--features just-types` and `--features just-types-and-namespace` (their value maps were identical); Kotlin and Scala 3 lose `--framework just-types`; Smithy4s loses its single-value `--framework` option entirely. Every language now spells it the way the other 15 always have: the boolean `--just-types`, which wins over a conflicting explicit `--features`/`--framework`. Scala 3's default changes with this: a bare `quicktype -l scala3` now generates circe (de)serialization instead of plain case classes — plain types now require asking for `--just-types`, like in every other language. The VS Code extension's per-language special-casing collapses into a single check for whether the target language has a `just-types` option (fixing a bug where its "just types" commands silently did nothing for languages other than C# and Kotlin), and the Smithy4s test fixture migrates to the boolean spelling. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
--just-typesis the common spelling for "plain types, no (de)serialization helpers" — 15 languages accept it as a boolean option. But C# spelled it--features just-types, and Kotlin, Scala 3, and Smithy4s--framework just-types, so the flag everyone reaches for first failed withOption parsing failed: Unknown option: --just-types.What this does
Warning
This is a breaking change. It targets the next major version. The enum spellings are removed, not deprecated: they now fail with
Unknown value just-types for option …(CLI and API alike).Every quicktype language now spells "plain types" the same way: the boolean
--just-types. It goes through the normal option registry, so it shows up in--helpand in the typedrendererOptionsmaps. When both--just-typesand an explicit--features/--frameworkare given,--just-typeswins.Migration
--features just-types--just-types--features just-types-and-namespace--just-types(the two enum values had identical semantics)--framework just-types--just-types--framework just-types--just-types--framework just-types--just-types— or nothing: plain types is Smithy4s's only mode, and its single-value--frameworkoption is goneAPI callers: same renames in
rendererOptions(e.g.{ framework: "just-types" }→{ "just-types": true }).--framework just-typeswas Scala 3's default, and a removed enum value can't stay the default. The default is now circe: a barequicktype -l scala3generates circe (de)serialization instead of plain case classes. To keep the old output, pass--just-types. Kotlin's default (klaxon) and C#'s default (--features complete, Newtonsoft) are unchanged.Cleanups this enables
featuresenum keepscomplete(default) andattributes-only; the renderers derive "need helpers/attributes" fromfeaturesandjustTypesdirectly.if (justTypes)in front of the framework switch; Smithy4s's framework switch (markedFIXME: why does this exist) is deleted.rustas its "another language's option" compile-error case (Rust really has nojust-types).Testing
Unit tests (all 119 green) assert:
--just-typesyields plain output for all four languages; the removed enum spellings raiseUnknown value … for option …; the boolean wins over a conflicting explicit enum for C#/Kotlin/Scala 3; Scala 3's bare default now emits circe and Kotlin's stays klaxon. Verified--just-types, the conflict rule, the new errors, and--helpfor all four languages with the built CLI. The Smithy4s fixture definition migrates to{ "just-types": "true" }(kotlinc isn't available in this environment, so the compile fixtures ride on CI).🤖 Generated with Claude Code