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
+30-17Lines changed: 30 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,10 @@ A mapping YAML looks like this:
12
12
openapi-processor-mapping: {var-mapping-version}
13
13
14
14
options:
15
-
package-name: io.openapiprocessor.sample
15
+
package-name: io.openapiprocessor.openapi
16
+
package-names:
17
+
base: io.openapiprocessor.openapi # same as option.package-name
18
+
location: io.openapiprocessor
16
19
package-name-from-path: true
17
20
model-name-suffix: Resource
18
21
model-type: record
@@ -41,7 +44,7 @@ map:
41
44
# java type mappings
42
45
----
43
46
44
-
The only required option is `package-name`. All other options or the type mappings are optional.
47
+
The only required option is `package-name` or alternativly `package-names.base`. All other options or the type mappings are optional.
45
48
46
49
== options:
47
50
@@ -67,30 +70,40 @@ options:
67
70
package-name: io.openapiprocessor.sample
68
71
----
69
72
70
-
=== package-name-from-path (new with 2025.3)
73
+
=== package-names (new with 2025.3)
71
74
72
-
**optional** (boolean, `true` or `false`, default is `false`)
75
+
parent key to group package-name related options.
76
+
// See xref:processor/server-url.adoc[].
73
77
74
-
`package-name-from-path` enables the creation of package names based on the file location of $ref'erenced parts of the OpenAPI description.
78
+
[#_package_names_base]
79
+
=== package-names:base
75
80
76
-
Enabling this has a few requirements:
81
+
**required/optional** (string)
77
82
78
-
- `package-name` must match a specific *parent* package name of the *target* package in the production code:
79
-
+
80
-
The *parent* package is shorter than the *target* package, and the *target* package starts with the *parent* package.
81
-
+
82
-
This is hard to explain in a few words. See the link below for an example.
83
+
the root (java) package name of the generated interfaces & models. The package folder tree will be created inside the `targetDir`.
84
+
85
+
This is the same as `package-name`. Only one of `package-name` or `package-names.base` is *required*.
86
+
87
+
It takes precedence above `package-name` if both ar set.
88
+
89
+
[#_package_names_location]
90
+
=== package-names:location
91
+
92
+
**optional** (string)
93
+
94
+
`package-names.location` enables the creation of package names based on the file location of $ref'erenced parts of the OpenAPI description.
95
+
96
+
It is the *parent* package for location based package names.
97
+
98
+
Only (OpenAPI) file locations below the parent package will be generated with a location based package name. Any other (OpenAPI) file location will use `package-names.base` (or `package-name`) as the package name.
99
+
100
+
Enabling this has a few conditions:
83
101
84
102
- to create an interface or resource in a specific package, its OpenAPI description has to be in the target package and must be reachable from the root OpenAPI description.
85
103
86
104
- it only works with the `INTERNAL` OpenAPI parser (it is the default parser). It will not work with the `SWAGGER` OpenAPI parser.
87
105
88
-
See xref:processor/package-names.adoc[package-names] for a description with an example. It explains which package is the *parent* package and how to place OpenAPI parts into packages.
89
-
90
-
[WARNING]
91
-
====
92
-
This is still a bit experimental and may not behave nicely if the expected configuration requirements are not met.
93
-
====
106
+
See xref:processor/package-names.adoc[package-names] for a description with an example. It explains the *parent* package and how to place OpenAPI parts into packages.
0 commit comments