Skip to content

Default addGeneratedAnnotation and disableDatesInGeneratedAnnotation to true#942

Draft
jiholee17 wants to merge 3 commits intomasterfrom
feature/generated-annotation-by-default
Draft

Default addGeneratedAnnotation and disableDatesInGeneratedAnnotation to true#942
jiholee17 wants to merge 3 commits intomasterfrom
feature/generated-annotation-by-default

Conversation

@jiholee17
Copy link
Copy Markdown
Collaborator

@jiholee17 jiholee17 commented Apr 23, 2026

This PR flips the default for the addGeneratedAnnotation and disableDatesInGeneratedAnnotation configuration flags:

  • addGeneratedAnnotation: False → True
  • disableDatesInGeneratedAnnotation: False → True

This 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>.Generated

To disable Generated annotations, set addGeneratedAnnotation = false in your codegen configuration block.

Note: To be compatible with this default, consumers need jakarta.annotation-api:2.+ on compileClasspath, which is brought in transitively by Spring Boot 3+.

For more on annotations: https://netflix.github.io/dgs/generating-code-from-schema/#annotations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant