File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
library/src/main/scala/za/co/absa/springdocopenapiscala Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -225,7 +225,9 @@ val registration = OpenAPIModelRegistration(
225
225
components,
226
226
config = RegistrationConfig (
227
227
OpenAPIModelRegistration .RegistrationConfig (
228
- sumADTsShape = OpenAPIModelRegistration .RegistrationConfig .SumADTsShape .WithDiscriminator ()
228
+ sumADTsShape =
229
+ // default values apply for discriminatorPropertyNameFn, addDiscriminatorPropertyOnlyToDirectChildren
230
+ OpenAPIModelRegistration .RegistrationConfig .SumADTsShape .WithDiscriminator ()
229
231
)
230
232
)
231
233
)
Original file line number Diff line number Diff line change @@ -160,7 +160,10 @@ class OpenAPIModelRegistration(
160
160
val constEnumSchema = createConstEnumSchema(discriminatorValue.getOrElse(name))
161
161
actualSchema.addProperty(discriminatorPropertyName, constEnumSchema)
162
162
actualSchema.addRequiredItem(discriminatorPropertyName)
163
- } else if (! addOnlyToDirectChildren && Option (actualSchema.getOneOf).map(! _.isEmpty).getOrElse(false )) {
163
+ } else if (
164
+ ! addOnlyToDirectChildren &&
165
+ Option (actualSchema.getOneOf).map(! _.isEmpty).getOrElse(false ) // is schema representing another sum ADT root
166
+ ) {
164
167
addDiscriminatorPropertyToChildren(
165
168
actualSchema,
166
169
discriminatorPropertyName,
You can’t perform that action at this time.
0 commit comments