Skip to content

Commit f3c7d7b

Browse files
committed
1 parent 4c3ca66 commit f3c7d7b

File tree

1 file changed

+30
-17
lines changed

1 file changed

+30
-17
lines changed

docs/modules/ROOT/pages/processor/configuration.adoc

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ A mapping YAML looks like this:
1212
openapi-processor-mapping: {var-mapping-version}
1313
1414
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
1619
package-name-from-path: true
1720
model-name-suffix: Resource
1821
model-type: record
@@ -41,7 +44,7 @@ map:
4144
# java type mappings
4245
----
4346

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.
4548

4649
== options:
4750

@@ -67,30 +70,40 @@ options:
6770
package-name: io.openapiprocessor.sample
6871
----
6972

70-
=== package-name-from-path (new with 2025.3)
73+
=== package-names (new with 2025.3)
7174

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[].
7377

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
7580

76-
Enabling this has a few requirements:
81+
**required/optional** (string)
7782

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:
83101

84102
- 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.
85103

86104
- it only works with the `INTERNAL` OpenAPI parser (it is the default parser). It will not work with the `SWAGGER` OpenAPI parser.
87105

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.
94107

95108
=== model-name-suffix
96109

0 commit comments

Comments
 (0)