Draft
Conversation
31952a4 to
03e7232
Compare
scmorse
reviewed
Apr 27, 2026
scmorse
left a comment
There was a problem hiding this comment.
I know you said this is still a WIP, but I noticed some other files that probably need some updates:
wire-compiler/src/main/java/com/squareup/wire/WireCompiler.ktwire-gradle-plugin/src/main/kotlin/com/squareup/wire/gradle/WireOutput.ktwire-gradle-plugin/api/wire-gradle-plugin.apiwire-compiler/src/test/java/com/squareup/wire/WireCompilerTest.ktdocs/wire_compiler.md
| * Converts a snake_case field name to PascalCase for use as a sealed class subtype name. | ||
| * For example: `card_id` → `CardId`, `bank_account` → `BankAccount`. | ||
| */ | ||
| private fun String.toSealedSubclassName(): String = split("_").joinToString("") { part -> part.replaceFirstChar { it.uppercaseChar() } } |
There was a problem hiding this comment.
Should sealed subtype names go through NameAllocator / existing Wire casing helpers instead of a custom split("_") conversion?
| .build(), | ||
| ) | ||
| .addProperty( | ||
| PropertySpec.builder("value", valueType) |
There was a problem hiding this comment.
Would it be worthwhile to include field options on the value property? e.g. deprecated/redacted/etc
| val subclass = TypeSpec.classBuilder(subclassName) | ||
| .addModifiers(DATA) | ||
| .superclass(sealedClassName) | ||
| .primaryConstructor( |
There was a problem hiding this comment.
Should the sealed class instances per-field use the builder pattern if buildersOnly is configured?
55ce945 to
7c70231
Compare
7c70231 to
fad4166
Compare
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.
Fixes #2749