Skip to content

Commit 53643f8

Browse files
committed
minor
1 parent c9a3b44 commit 53643f8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

commons-core/src/main/scala/com/avsystem/commons/rest/openapi/RestStructure.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ object RestStructure extends AdtMetadataCompanion[RestStructure] {
4444
})
4545
Discriminator(caseFieldName, mapping)
4646
}
47-
RefOr(applyAdjusters(Schema(oneOf = caseSchemas, discriminator = disc.toOptArg)))
47+
RefOr(applyAdjusters(Schema(
48+
`type` = DataType.Object,
49+
oneOf = caseSchemas,
50+
discriminator = disc.toOptArg
51+
)))
4852
}
4953
}
5054
object Union extends AdtMetadataCompanion[Union]

commons-core/src/test/scala/com/avsystem/commons/rest/openapi/OpenApiGenerationTest.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,7 @@ class OpenApiGenerationTest extends FunSuite {
471471
| "components": {
472472
| "schemas": {
473473
| "BaseEntity": {
474+
| "type": "object",
474475
| "oneOf": [
475476
| {
476477
| "type": "object",
@@ -523,6 +524,7 @@ class OpenApiGenerationTest extends FunSuite {
523524
| ]
524525
| },
525526
| "FlatBaseEntity": {
527+
| "type": "object",
526528
| "description": "Flat sealed entity with some serious cases",
527529
| "oneOf": [
528530
| {

0 commit comments

Comments
 (0)