Default addGeneratedAnnotation and disableDatesInGeneratedAnnotation to true#942
Draft
Default addGeneratedAnnotation and disableDatesInGeneratedAnnotation to true#942
addGeneratedAnnotation and disableDatesInGeneratedAnnotation to true#942Conversation
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.
This PR flips the default for the
addGeneratedAnnotationanddisableDatesInGeneratedAnnotationconfiguration flags:addGeneratedAnnotation: False → TruedisableDatesInGeneratedAnnotation: False → TrueThis lets coverage and static-analysis tools (i.e. JaCoCo) auto-exclude generated code without project-specific config, and marks boundaries between generated and hand-written code for readers.
Unless configured otherwise, every generated class, interface, enum, data fetcher, input type, constants holder, GraphQL query type, and projection type now carries two annotations:
@jakarta.annotation.Generated("com.netflix.graphql.dgs.codegen.CodeGen")@<config.packageName>.GeneratedTo disable Generated annotations, set
addGeneratedAnnotation = falsein your codegen configuration block.Note: To be compatible with this default, consumers need
jakarta.annotation-api:2.+oncompileClasspath, which is brought in transitively by Spring Boot 3+.For more on annotations: https://netflix.github.io/dgs/generating-code-from-schema/#annotations