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/mapping/annotation.adoc
+6-34Lines changed: 6 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,21 +5,21 @@ It is possible to add additional annotations to a `source type`. Currently, this
5
5
6
6
* global _annotation type mapping_:
7
7
+
8
-
it adds an annotation to the model class generated for the `source type`.
8
+
it adds an annotation to the *model class* generated for the `source type`.
9
9
10
10
* global & endpoint parameter _annotation type mapping_:
11
11
+
12
-
it adds an annotation to a parameter of the `source type`. Since the request body is passed as parameter the mapping will work for it too.
12
+
it adds an annotation to a *parameter* of the `source type` (this includes request body parameters).
13
13
14
-
It is defined like below, and it should be added to the `map/types` or `map/parameters` section in the mapping.yaml.
14
+
The global annotation mapping should be added to the `map/types` or `map/parameters` section in the mapping.yaml.
15
15
16
-
It is also available as an endpoint (http method) mapping to restrict the mapping to a specific endpoint. This will go to the `map/paths/<endpoint path>/parameters` section in the mapping.yaml.
16
+
The endpoint (http method) mapping restricts the mapping to a specific endpoint. This will go to the `map/paths/<endpoint path>/parameters` section in the mapping.yaml.
17
17
18
18
The annotation type mapping is similar to other mappings and is defined like this:
19
19
20
20
[source,yaml]
21
21
----
22
-
- type: {source type} @ {annotation type}
22
+
type: {source type} @ {annotation type}
23
23
----
24
24
25
25
* **type** is required.
@@ -135,7 +135,7 @@ The `Sum` annotation in the example is a custom bean validation but the feature
135
135
<1> use `v2.1` as the mapping version to avoid validation warnings in the mapping file.
136
136
<2> the `Bar` mapping is using a global type annotation mapping, so the annotation is added to the generated `Bar` class.
137
137
<3> the `Foo` mapping adds the annotation to the parameter of the endpoint methods that use `Foo`.
138
-
<4> this is a list of examples that shows annotation parameters. It is nearly java code.
138
+
<4> this is a list of examples that shows annotation parameters.
139
139
140
140
Here are the generated interfaces, first the `FooApi`:
0 commit comments