mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-03-10 08:31:23 +00:00
Add OpenAPI Normalizer (#14172)
* add x-parent support * add docstring * add openapi normalizer rule to use ref as parent in allof * add openapi normalizer with 1 rule * revise wordings * fix javadoc warnings * better test * fix docstring * minor update * minor improvements * fix typo
This commit is contained in:
@@ -451,3 +451,16 @@ Another useful option is `inlineSchemaNameDefaults`, which allows you to customi
|
||||
```
|
||||
|
||||
Note: Only arrayItemSuffix, mapItemSuffix are supported at the moment. `SKIP_SCHEMA_REUSE=true` is a special value to skip reusing inline schemas.
|
||||
|
||||
## OpenAPI Normalizer
|
||||
|
||||
OpenAPI Normalizer (off by default) transforms the input OpenAPI doc/spec (which may not perfectly conform to the specification) to make it workable with OpenAPI Generator. Here is a list of rules supported:
|
||||
|
||||
- `REF_AS_PARENT_IN_ALLOF`: when set to `true`, child schemas in `allOf` is considered a parent if it's a `$ref` (instead of inline schema)
|
||||
|
||||
|
||||
Example:
|
||||
```
|
||||
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/allOf_extension_parent.yaml -o /tmp/java-okhttp/ --additional-properties hideGenerationTimestamp="true" --openapi-normalizer REF_AS_PARENT_IN_ALLOF=true
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user