Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ OpenAPI Normalizer transforms the input OpenAPI doc/spec (which may not perfectl

- SIMPLIFY_ONEOF_ANYOF
- SIMPLIFY_BOOLEAN_ENUM
- REFACTOR_ALLOF_WITH_PROPERTIES_ONLY

(One can use `DISABLE_ALL=true` to disable all the rules)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ public OpenAPINormalizer(OpenAPI openAPI, Map<String, String> inputRules) {
rules.put(SIMPLIFY_ONEOF_ANYOF, true);
rules.put(SIMPLIFY_BOOLEAN_ENUM, true);
rules.put(SIMPLIFY_ONEOF_ANYOF_ENUM, true);
rules.put(REFACTOR_ALLOF_WITH_PROPERTIES_ONLY, true);

processRules(inputRules);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4812,7 +4812,7 @@ public void testMultiInheritanceParentRequiredParams_issue16797() throws IOExcep
// super(responseType, requestId, success, pageInfo);
// }
JavaFileAssert.assertThat(output.get("Object4.java"))
.assertConstructor("Type1", "String", "String", "Boolean")
.assertConstructor("String", "String", "Boolean", "Type1")
.hasParameter("responseType").toConstructor()
.hasParameter("requestId").toConstructor()
.hasParameter("success").toConstructor()
Expand Down
122 changes: 79 additions & 43 deletions samples/client/others/java/webclient-sealedInterface/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,20 @@ components:
allOf:
- $ref: "#/components/schemas/Addressable"
- $ref: "#/components/schemas/Extensible"
description: Entity reference schema to be use for all entityRef class.
- description: Entity reference schema to be use for all entityRef class.
properties:
name:
description: Name of the related entity.
type: string
'@referredType':
description: The actual type of the target instance when needed for disambiguation.
type: string
type: object
example: null
discriminator:
propertyName: '@type'
properties:
name:
description: Name of the related entity.
type: string
'@referredType':
description: The actual type of the target instance when needed for disambiguation.
type: string
type: object
example: null
FooRefOrValue:
discriminator:
propertyName: '@type'
Expand All @@ -151,58 +154,82 @@ components:
Foo:
allOf:
- $ref: "#/components/schemas/Entity"
- properties:
fooPropA:
type: string
fooPropB:
type: string
type: object
example: null
example:
'@baseType': '@baseType'
'@type': '@type'
fooPropA: fooPropA
href: href
id: id
fooPropB: fooPropB
properties:
fooPropA:
type: string
fooPropB:
type: string
'@schemaLocation': '@schemaLocation'
type: object
FooRef:
allOf:
- $ref: "#/components/schemas/EntityRef"
properties:
foorefPropA:
type: string
- properties:
foorefPropA:
type: string
type: object
example: null
type: object
example: null
BarRef:
allOf:
- $ref: "#/components/schemas/EntityRef"
type: object
Bar_Create:
allOf:
- $ref: "#/components/schemas/Entity"
properties:
barPropA:
type: string
fooPropB:
type: string
foo:
$ref: "#/components/schemas/FooRefOrValue"
- properties:
barPropA:
type: string
fooPropB:
type: string
foo:
$ref: "#/components/schemas/FooRefOrValue"
type: object
example: null
type: object
example: null
Bar:
allOf:
- $ref: "#/components/schemas/Entity"
- properties:
id:
type: string
barPropA:
type: string
fooPropB:
type: string
foo:
$ref: "#/components/schemas/FooRefOrValue"
required:
- id
type: object
example: null
example:
'@baseType': '@baseType'
'@type': '@type'
foo:
'@baseType': '@baseType'
'@type': '@type'
fooPropA: fooPropA
href: href
id: id
fooPropB: fooPropB
'@schemaLocation': '@schemaLocation'
href: href
id: id
fooPropB: fooPropB
'@schemaLocation': '@schemaLocation'
barPropA: barPropA
properties:
id:
type: string
barPropA:
type: string
fooPropB:
type: string
foo:
$ref: "#/components/schemas/FooRefOrValue"
required:
- id
type: object
BarRefOrValue:
oneOf:
Expand All @@ -213,24 +240,33 @@ components:
Pizza:
allOf:
- $ref: "#/components/schemas/Entity"
properties:
pizzaSize:
type: number
- properties:
pizzaSize:
type: number
type: object
example: null
type: object
example: null
Pasta:
allOf:
- $ref: "#/components/schemas/Entity"
properties:
vendor:
type: string
- properties:
vendor:
type: string
type: object
example: null
type: object
example: null
PizzaSpeziale:
allOf:
- $ref: "#/components/schemas/Pizza"
properties:
toppings:
type: string
- properties:
toppings:
type: string
type: object
example: null
type: object
example: null
FruitType:
enum:
- APPLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@

# EntityRef

Entity reference schema to be use for all entityRef class.

## Properties

| Name | Type | Description | Notes |
|------------ | ------------- | ------------- | -------------|
|**name** | **String** | Name of the related entity. | [optional] |
|**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] |
|**href** | **String** | Hyperlink reference | [optional] |
|**id** | **String** | unique identifier | [optional] |
|**atSchemaLocation** | **String** | A URI to a JSON-Schema file that defines additional attributes and relationships | [optional] |
|**atBaseType** | **String** | When sub-classing, this defines the super-class | [optional] |
|**atType** | **String** | When sub-classing, this defines the sub-class Extensible name | |
|**name** | **String** | Name of the related entity. | [optional] |
|**atReferredType** | **String** | The actual type of the target instance when needed for disambiguation. | [optional] |



Loading
Loading