[do-not-merge] Generate a file with TypeMarkers for each errors namespace#2846
Open
[do-not-merge] Generate a file with TypeMarkers for each errors namespace#2846
TypeMarkers for each errors namespace#2846Conversation
added 3 commits
March 23, 2026 14:44
Generate changelog in
|
[skip ci]
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.
Before this PR
Each Dialogue service interface constructs two
TypeMarkers per Conjure error:conjure-java/conjure-java-core/src/integrationInput/java/exceptionthrowingdialogueinterfaces/com/palantir/product/EteServiceBlocking.java
Lines 461 to 466 in 8ed34f3
The construction of these
TypeMarkers are duplicated in every service in defined in the Conjure definition with the declared errors. For some projects with many errors and services, this leads to a sharp increase in the number of anonymous classes generated which creates load on build tooling: e.g. JARs need to be compressed and lots more classes need to be loaded.After this PR
A new
{Namespace}ErrorsTypeMarkersclass is generated per error namespace in the Dialogue output, holdingshared public static final TypeMarker constants:
Service interfaces now reference these constants instead of creating anonymous classes:
The TypeMarkers class is generated into the
-dialogueproject (not the-objectsoutput) so it doesn't require adding dialogue-target as a dependency to the objects project.==COMMIT_MSG==
Generate a file with
TypeMarkers for each errors namespace==COMMIT_MSG==
Possible downsides?
I would've preferred to generate these
TypeMarkeranonymous classes in each of the generated<Error>SerializableErrorand<Error>Exceptionclasses, but theTypeMarkeris defined indialogue-targetand I did not want to force all consumers to-objectsJARs to require a new API dep ondialogue-target.I don't think there is anything specific to dialogue about
TypeMarker: in the future, we can consider moving this class out to another project.