Skip to content

Commit

Permalink
doc: Kotlin supports repeatable annotations since 1.6 (#10755)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehearn committed Apr 25, 2024
1 parent dc3e41f commit 533a099
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/main/docs/guide/ioc/conditionalBeans.adoc
Expand Up @@ -8,8 +8,6 @@ snippet::io.micronaut.docs.requires.JdbcBookService[tags="requires",indent=0, ti

The above bean defines two requirements. The first indicates that a `DataSource` bean must be present for the bean to load. The second requirement ensures that the `datasource.url` property is set before loading the `JdbcBookService` bean.

NOTE: Kotlin currently does not support repeatable annotations. Use the `@Requirements` annotation when multiple requires are needed. For example, `@Requirements(Requires(...), Requires(...))`. See https://youtrack.jetbrains.com/issue/KT-12794 to track this feature.

If multiple beans require the same combination of requirements, you can define a meta-annotation with the requirements:

snippet::io.micronaut.docs.requires.RequiresJdbc[tags="annotation",indent=0, title="Using a @Requires meta-annotation"]
Expand Down

0 comments on commit 533a099

Please sign in to comment.