You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/processor/configuration.adoc
+41Lines changed: 41 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -503,6 +503,47 @@ options:
503
503
layout: standard
504
504
----
505
505
506
+
== annotation-targets: ([.badge .badge-since]+new with 2025.6+)
507
+
508
+
This section is used to configure the *allowed* targets of an annotation. This is like `java.lang.annotation.Target` which is used to define at which places an annotation can be used. On a type, field, method or property etc.
509
+
510
+
The new section `annotation-targets` is a map from annotation name to set of allowed targets.
511
+
512
+
The list of allowed targets is currently: `'type'`, `'field'`, `'method'` and `'parameter'`.
513
+
514
+
[source,yaml,subs=attributes+]
515
+
----
516
+
openapi-processor-mapping: {var-mapping-version}
517
+
options:
518
+
package-name: pkg
519
+
520
+
map:
521
+
types:
522
+
- type: Foo @ lombok.Builder
523
+
524
+
annotation-targets:
525
+
# possible entries 'type', 'field', 'method' & 'parameter'
526
+
lombok.Builder: ['type', 'method']
527
+
----
528
+
529
+
Internally, the processor has a default list of "known" annotations. It is not necessary to add those manually unless to overide it.
530
+
531
+
The purpose of this configuration is to help the processor placing annotations. The processor may put an annotation at a place where it is not allowed. For example, it should not put `lombok.Builder` on method parameters or an annotation is not allowed on a mapped type.
532
+
533
+
534
+
[NOTE]
535
+
====
536
+
Why doesn't openapi-processor directly check the allowed targets of `java.lang.annotation.Target` ?
537
+
538
+
It can't check the allowed targets directly, because the annotations are usually not available on teh processors classpath. They are just strings from the mapping.
539
+
====
540
+
541
+
=== known annotations
542
+
543
+
The default list is quite short at the moment but can grow:
544
+
545
+
* `lombok.Builder: ['type', 'method']`
546
+
506
547
== logging:
507
548
508
549
This section contains keys for logging mapping lookups. It may be useful to locate mappings that should be used but are not.
0 commit comments